| Title: | Download Data Sets from Kenneth's French Finance Data Library Site |
|---|---|
| Description: | Download data sets from Kenneth's French finance data library site <http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html>, reads all the data subsets from the file. Allows R users to collect the data as 'tidyverse'-ready data frames. |
| Authors: | Nelson Areal [aut, cre] (ORCID: <https://orcid.org/0000-0002-1157-0178>) |
| Maintainer: | Nelson Areal <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0.9200 |
| Built: | 2026-05-27 09:05:06 UTC |
| Source: | https://github.com/nareal/frenchdata |
Opens the details webpage of a data set on the default browser.
browse_details_page(fds)browse_details_page(fds)
fds |
an object of class |
Does not return a value. Opens the details webpage of a data set on the default browser window.
if(interactive()){ ff_3f <- download_french_data('Fama/French 3 Factors') browse_details_page(ff_3f) }if(interactive()){ ff_3f <- download_french_data('Fama/French 3 Factors') browse_details_page(ff_3f) }
Opens the data library website on the default browser https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
browse_french_site()browse_french_site()
Does not return a value. Opens the Kenneth's French data library website with the default browser.
if(interactive()){ browse_french_site() }if(interactive()){ browse_french_site() }
Download the data set
download_french_data( dataset_name, dir = NULL, dest_file = NULL, overwrite = FALSE, max_tries = 3 )download_french_data( dataset_name, dir = NULL, dest_file = NULL, overwrite = FALSE, max_tries = 3 )
dataset_name |
string with the data set name. Use |
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 |
overwrite |
boolean. Overwrite an existing file? |
max_tries |
numeric. Number of file download trials. |
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 a name and data column.
ff_3f <- download_french_data('Fama/French 3 Factors') ff_3fff_3f <- download_french_data('Fama/French 3 Factors') ff_3f
french_data_list S3 classThe french_data_list exists to hold the results of reading the files lists of Kenneth's French data library.
It provides a method to print the objects of this class.
french_data_list
Objects of class french_data_list have:
A class attribute of french_data_list.
A base type of "list" with the following elements:
info - holds the information about when and were the information was retrieved.
files_list a tibble with with a list of files that can be downloaded, the tibble contains a name, file_url and details_url column.
french_data_list
Pretty prints the object.
french_dataset S3 classThe french_dataset exists to hold the results of reading the files lists of Kenneth's French data library.
It provides a method to print the objects of this class.
french_dataset
Objects of class french_dataset have:
A class attribute of french_dataset.
A base type of "list" 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 a name and data column.
french_dataset
Pretty prints the object.
Extract the list of files along with a description and links to them and additional information from the data library page of Prof. Kenneth French website.
get_french_data_list(max_tries = 3, refresh = FALSE)get_french_data_list(max_tries = 3, refresh = FALSE)
max_tries |
a number defining the maximum number of tries to perform when downloading the page. |
refresh |
logical. If TRUE re-downloads the page and overwrites the cached information. Otherwise use the cached data if a download has been done in the current session. |
An object of class french_data_list with the following elements:
info - holds the information about when and were the information was retrieved.
files_list a tibble with with a list of files that can be downloaded, the tibble contains a name, file_url and details_url column.
files_list <- get_french_data_list() files_listfiles_list <- get_french_data_list() files_list
french_data_list
Prints an object of class french_data_list
## S3 method for class 'french_data_list' print(x, ...)## S3 method for class 'french_data_list' print(x, ...)
x |
an object of class |
... |
other arguments passed to |
Return a tbl_df/data.frame class object from the files_list element of x.
files_list <- get_french_data_list() print(files_list) files_listfiles_list <- get_french_data_list() print(files_list) files_list
french_dataset
Prints an object of class french_dataset
## S3 method for class 'french_dataset' print(x, ...)## S3 method for class 'french_dataset' print(x, ...)
x |
an object of class |
... |
other arguments passed to |
Return a tbl_df/data.frame class object from the subsets element of x.
ff_3f <- download_french_data('Fama/French 3 Factors') print(ff_3f) ff_3fff_3f <- download_french_data('Fama/French 3 Factors') print(ff_3f) ff_3f