Download the data set
Usage
download_french_data(
dataset_name,
dir = NULL,
dest_file = NULL,
overwrite = FALSE,
max_tries = 3
)
Arguments
- dataset_name
string with the data set name. Use
get_french_data_list()
to get the list of data sets available to download.- dir
character. Should be a valid directory path where to save the compressed downloaded file.
- dest_file
character. Should be a valid file name to save the compressed downloaded file. If
dir
is defined anddest_file
is left empty, the original file name will be used.- overwrite
boolean. Overwrite an existing file?
- max_tries
numeric. Number of file download trials.
Value
An objects of class french_dataset
with the following elements:
info
- holds the information about when and were the information was retrieved.details_url
- url for the webpage with details on data set.subsets
a tibble with with the subsets contained in the downloaded file, the tibble contains aname
anddata
column.
Examples
# \donttest{
ff_3f <- download_french_data('Fama/French 3 Factors')
ff_3f
#>
#> ── Kenneth's French data set
#> ℹ This file was created by CMPT_ME_BEME_RETS using the 202401 CRSP database. The 1-month TBill return is from Ibbotson and Associates, Inc.
#>
#> Information collected from: https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_CSV.zip on Fri Mar 22 17:54:24 2024
#>
#> ℹ For details on the data set call the function `browse_details_page()` on this object
#>
#> ── Subsets in the file:
#> # A tibble: 2 × 2
#> name data
#> <chr> <list>
#> 1 "" <spc_tbl_ [1,171 × 5]>
#> 2 "Annual Factors: January-December" <spc_tbl_ [97 × 5]>
# }