download_data {tidyfinance} | R Documentation |
Download and Process Data Based on Type
Description
Downloads and processes data based on the specified type (e.g., Fama-French factors, Global Q factors, or macro predictors), and date range. This function checks if the specified type is supported and then delegates to the appropriate function for downloading and processing the data.
Usage
download_data(type, start_date, end_date)
Arguments
type |
The type of dataset to download, indicating either factor data or macroeconomic predictors. |
start_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the data. If not provided, the full dataset or a subset is returned, dependening on the dataset type. |
end_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the end date for the data. If not provided, the full dataset or a subset is returned, depending on the dataset type. |
Value
A tibble with processed data, including dates and the relevant financial metrics, filtered by the specified date range.
Examples
download_data("factors_ff_3_monthly", "2000-01-01", "2020-12-31")
download_data("macro_predictors_monthly", "2000-01-01", "2020-12-31")