French: Download Datasets from Kenneth French's Data Library

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/market_data.R

Description

Download datasets from Kenneth French's Data Library.

Usage

1
2
3
French(dest.dir, dataset = "F-F_Research_Data_Factors_CSV.zip",
       weighting = "value", frequency = "monthly",
       price.series = FALSE, na.rm = FALSE)

Arguments

dest.dir

character: a path to a directory

dataset

a character string: the file name

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?

Details

The function downloads data provided by Kenneth French at http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html.

The download file gets a date prefix (today 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 used.

Missing values are usually coded as -99 or similar values in the original data files. These numeric values are replaced by NA.

Value

a data.frame

Author(s)

Enrico Schumann

See Also

Shiller

Examples

1
2
3
4
5
6
7
## Not run: 
archive.dir <- "~/Downloads/French"
if (!dir.exists(archive.dir))
    dir.create(archive.dir)
French(archive.dir, "F-F_Research_Data_Factors_CSV.zip")

## End(Not run)

enricoschumann/NMOF documentation built on Feb. 14, 2019, 2:21 p.m.