View source: R/gtdd_download_TD_data.R
download.TD.data | R Documentation |
This function looks into the tesouro direto website (https://www.tesourodireto.com.br/) and downloads all of the files containing prices and yields of government bonds. You can use input asset.codes to restrict the downloads to specific bonds
download.TD.data(
asset.codes = "LTN",
dl.folder = get_cache_folder(),
do.clean.up = FALSE,
do.overwrite = FALSE,
n.dl = NULL
)
asset.codes |
Strings that identify the assets (1 or more assets) in the names of the excel files. E.g. asset.codes = 'LTN'. When set to NULL, it will download all available assets |
dl.folder |
Name of folder to save excel files from tesouro direto (will create if it does not exists) |
do.clean.up |
Clean up folder before downloading? (TRUE or FALSE) |
do.overwrite |
Overwrite excel files? (TRUE or FALSE). If FALSE, will only download the new data for the current year |
n.dl |
Sets how many files to download from the website. Used only to decrease CRAN CHECK time. The default value is NULL (downloads all files) |
TRUE if successful
# only download file where string LTN is found
# (only 1 file for simplicity)
## Not run:
download.TD.data(asset.codes = 'LTN', n.dl = 1)
## End(Not run)
# The excel file should be available in folder 'TD Files' (default name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.