Learn R Programming

tidyfinance (version 0.4.3)

download_data_constituents: Download Constituent Data

Description

This function 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.

Usage

download_data_constituents(index)

Value

A tibble with two columns:

symbol

The ticker symbol of the equity constituent.

name

The name of the equity constituent.

location

The location where the company is based.

exchange

The exchange where the equity is traded.

The tibble is filtered to exclude non-equity entries, blacklisted symbols, empty names, and any entries containing the index name or "CASH".

Arguments

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 list_supported_indexes.

Details

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 o ther ETFs.

Examples

Run this code
# \donttest{
  download_data_constituents("DAX")
# }

Run the code above in your browser using DataLab