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-05-11 544.92
#> 2: 2026-05-12 540.25
#> 3: 2026-05-13 546.81
#> 4: 2026-05-14 549.04
#> 5: 2026-05-15 546.22
#> 6: 2026-05-18 534.69
#> 7: 2026-05-19 533.10
#> 8: 2026-05-20 532.49
#> 9: 2026-05-21 529.09
#> 10: 2026-05-22 532.19
# }