Retrieve the price of gold from the NBP Web API.
Usage
nbp_gold(start_date = NULL, end_date = NULL, last_n = NULL)
Arguments
- start_date
(NULL | character(1) | Date(1))
Start date of the data.
- end_date
(NULL | character(1) | Date(1))
End date of the data.
- last_n
(NULL | integer(1))
Return only the last n quotations.
See also
Other data:
bbk_data(),
bbk_series(),
bde_data(),
bde_latest(),
bdf_codelist(),
bdf_data(),
bdf_dataset(),
bdp_data(),
bis_data(),
boc_data(),
boe_data(),
boj_data(),
ecb_data(),
nbp_fx_rates(),
nob_data(),
onb_data(),
snb_data(),
srb_cross_rates(),
srb_data()
Examples
# \donttest{
nbp_gold(last_n = 10L)
#> date price
#> <Date> <num>
#> 1: 2026-03-27 525.40
#> 2: 2026-03-30 529.66
#> 3: 2026-03-31 543.51
#> 4: 2026-04-01 549.34
#> 5: 2026-04-02 561.97
#> 6: 2026-04-03 552.46
#> 7: 2026-04-07 557.13
#> 8: 2026-04-08 555.24
#> 9: 2026-04-09 562.26
#> 10: 2026-04-10 554.60
# }