if (FALSE) {
# get all data to the year of 2001
meta <- download_marketdata("b3-cotahist-yearly", year = 2001)
read_marketdata(meta)
ds_yearly <- cotahist_get()
# Earliest available annual file: 1986
# Recommended starting point: 1995 (after Plano Real)
}
if (FALSE) {
# To obtain data from January 2, 2014, the earliest available date:
meta <- download_marketdata("b3-cotahist-daily", refdate = as.Date("2014-01-02"))
read_marketdata(meta)
ds_daily <- cotahist_get("daily")
}
if (FALSE) {
# Once you download more dates, the data downloaded before remains stored and you can filter
# any date you want.
meta <- download_marketdata("b3-cotahist-daily", refdate = as.Date("2014-01-03"))
read_marketdata(meta)
df_daily <- cotahist_get("daily") |>
filter(refdate == "2014-01-03") |>
collect()
}
Run the code above in your browser using DataLab