Retrieves the list of ETFs to track. Prefers the curated universe file
when available, then falls back to the cached snapshot or seed list.
Usage
get_etf_universe(n = 20, live = FALSE, file = NULL)
Arguments
- n
Integer. Maximum number of ETFs to return. Default is 20. Set to Inf for all.
- live
Logical. If TRUE, attempts to fetch the latest universe from an external source.
- file
Character. Path to a local CSV file to read the universe from. Overrides live and default cache.
Value
A tibble with columns: ticker, name, isin, currency
Examples
if (FALSE) { # \dontrun{
get_etf_universe() # Returns top 20
get_etf_universe(n = 5)
get_etf_universe(n = Inf) # Returns all
get_etf_universe(file = "my_etfs.csv")
} # }