View source: R/download_data_constituents.R
| download_data_constituents | R Documentation |
Downloads and processes the constituent data for a specified financial index. The data is fetched from a remote CSV file, filtered, and cleaned to provide relevant information about constituents.
download_data_constituents(index)
index |
A character string specifying the name of the financial index
for which to download constituent data. The index must be one of the
supported indexes listed by |
The function retrieves the URL of the CSV file for the specified index from ETF sites, then sends an HTTP GET request to download the CSV file, and processes the CSV file to extract equity constituents.
The approach is inspired by tidyquant::tq_index(), which uses a different
wrapper around other ETFs.
A tibble with five columns:
The ticker symbol of the equity constituent.
The name of the equity constituent.
The location where the company is based.
The exchange where the equity is traded.
The currency in which the equity is traded, derived from the exchange.
The tibble is filtered to exclude non-equity entries, blacklisted symbols, empty names, and any entries containing the index name or "CASH".
Other download functions:
download_data(),
download_data_factors_ff(),
download_data_factors_q(),
download_data_fred(),
download_data_huggingface(),
download_data_jkp(),
download_data_macro_predictors(),
download_data_osap(),
download_data_pastor_stambaugh(),
download_data_risk_free(),
download_data_stambaugh_yuan(),
download_data_stock_prices(),
download_factor_library_grid(),
download_factor_library_ids()
download_data_constituents("DAX")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.