bivariate_download: The bivariate_download function

Description Usage Arguments Value

View source: R/ffDataDownload.R

Description

This function automatically downloads Bivariate portfolios returns from the Kenneth R. French Data Library. The downloaded returns are saved then as a .csv-file in the chosen directory.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bivariate_download(
  base,
  dir,
  sub_path,
  number_factors,
  subtype,
  freq,
  dividends,
  start,
  end,
  cleanNAs
)

Arguments

base

a character string, the main webpage address "http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/".

dir

a character string, the directory for saving the data. The current working directory is set by default.

sub_path

a character string, the folder subpath, created by ffDataDownload.

number_factors

an integer, the number of factors for the Bivariate portfolios. Possible values are 6 (default), 25 or 100.

subtype

a character string, the Bivariate portfolio subtype. Possible values are "ME_BE" (default), "ME_OP", "ME_INV", "BEME_OP", "BEME_INV", "OP_INV".

freq

a character string, the frequency of the returns, "m" for monthly (default) or "d" for daily.

dividends

a logical, TRUE (default) considers dividends. FALSE downloads the data without dividends.

start

a character string, start date for the download in the format "YYmm". Default value is 197501.

end

a character string, end date for the download in the format "YYmm". Default value is two months before Sys.Date() to insure availability.

cleanNAs

a logical, TRUE (default) replaces NAs with zoo::na.locf(). If FALSE, NAs are not cleaned.

Value

a .csv-file within the directory, defined in dir.


antshi/ffData documentation built on Oct. 24, 2020, 9:56 p.m.