View source: R/download_data.R
| download_data | R Documentation |
Downloads and processes data based on the specified domain (e.g., Fama-French factors, Global Q factors, or macro predictors), dataset, and date range. This function checks if the specified domain is supported and then delegates to the appropriate function for downloading and processing the data.
download_data(
domain = NULL,
dataset = NULL,
start_date = NULL,
end_date = NULL,
type = deprecated(),
...
)
domain |
The domain of the dataset to download (e.g.,
"famafrench", "globalq", "macro_predictors", "wrds", "pseudo",
"constituents", "fred", "stock_prices", "osap", "tidyfinance").
Use |
dataset |
Optional. The specific dataset to download within the domain. |
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, depending 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. |
type |
|
... |
Additional arguments passed to specific download functions
depending on the |
A tibble with processed data, including dates and the relevant financial metrics, filtered by the specified date range.
Other download functions:
download_data_constituents(),
download_data_factors_ff(),
download_data_factors_q(),
download_data_fred(),
download_data_huggingface(),
download_data_macro_predictors(),
download_data_osap(),
download_data_risk_free(),
download_data_stock_prices(),
download_factor_library_grid(),
download_factor_library_ids()
download_data(
"famafrench",
"Fama/French 5 Factors (2x3) [Daily]",
"2000-01-01",
"2020-12-31"
)
download_data("macro_predictors", "monthly", "2000-01-01", "2020-12-31")
download_data("constituents", index = "DAX")
download_data("fred", series = c("GDP", "CPIAUCNS"))
download_data("stock_prices", symbols = c("AAPL", "MSFT"))
download_data(
"tidyfinance",
"risk_free",
"2020-01-01",
"2020-12-31"
)
download_data(
"tidyfinance",
"high_frequency_sp500",
"2007-07-26",
"2007-07-27"
)
download_data(
"tidyfinance",
"factor_library",
sorting_variable = "52w",
rebalancing = "annual"
)
download_data("tidyfinance", "factor_library", ids = c(1L, 2L, 3L))
download_data("tidyfinance", "factor_library_grid")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.