dataset: a character string: the CSV file name. Also supported are the keywords ‘market’ and ‘rf’ .
weighting: a character string: "equal" or "value"
frequency: a character string: daily, monthly or annual. Whether it is used or ignored depends on the particular dataset.
price.series: logical: convert the returns series into prices series?
na.rm: logical: remove missing values in the calculation of price series?
adjust.frequency: logical: if TRUE, frequency is switched to ‘"daily"’ when the word ‘"daily"’ appears in the dataset's name
return.class: a string: ‘data.frame’ (the default) or ‘zoo’
Details
The function downloads data provided by Kenneth French at https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html. The download file gets a date prefix (current date in format YYYYMMDD) and is stored in directory dest.dir. Before any download is attempted, the function checks whether a file with today's prefix exist in dest.dir; if yes, the file is used.
In the original data files, missing values are coded as -99 or similar. These numeric values are replaced by NA.
Calling the function without any arguments will print the names of the supported datasets (and return them insivibly).
For dataset ‘market’ , the function downloads the three-factor dataset, and adds excess return and risk-free rate. For dataset ‘rf’ , only the risk-free rate is returned.
Returns
A data.frame, with contents depending on the particular dataset, or an object as specified by return.class.
If the download fails, the function evaluates to NULL, typically with warnings.
References
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. tools:::Rd_expr_doi("10.1016/C2017-0-01621-X")