download_data_factors_ff {tidyfinance} | R Documentation |
Download and Process Fama-French Factor Data
Description
Downloads and processes Fama-French factor data based on the specified type (e.g., "factors_ff3_monthly"), and date range. The function first checks if the specified type is supported and requires the 'frenchdata' package to download the data. It processes the raw data into a structured format, including date conversion, scaling factor values, and filtering by the specified date range.
Usage
download_data_factors_ff(type, start_date, end_date)
Arguments
type |
The type of dataset to download, corresponding to the specific Fama-French model and frequency. |
start_date |
The start date for filtering the data, in "YYYY-MM-DD" format. |
end_date |
The end date for filtering the data, in "YYYY-MM-DD" format. |
Value
A tibble with processed factor data, including the date, risk-free rate, market excess return, and other factors, filtered by the specified date range.
Examples
download_data_factors_ff("factors_ff3_monthly", "2000-01-01", "2020-12-31")