yf_collection_get: Downloads a collection of data from Yahoo Finance

View source: R/yf_collections.R

yf_collection_getR Documentation

Downloads a collection of data from Yahoo Finance

Description

This function will use a set collection of YF data, such as index components and will download all data from Yahoo Finance using yf_get.

Usage

yf_collection_get(
  collection,
  first_date = Sys.Date() - 30,
  last_date = Sys.Date(),
  do_parallel = FALSE,
  do_cache = TRUE,
  cache_folder = yf_cachefolder_get(),
  ...
)

Arguments

collection

A collection to fetch data (e.g. "SP500", "IBOV", "FTSE" ). See function yf_get_available_collections for finding all available collections

first_date

The first date of query (Date or character as YYYY-MM-DD)

last_date

The last date of query (Date or character as YYYY-MM-DD)

do_parallel

Flag for using parallel or not (default = FALSE). Before using parallel, make sure you call function future::plan() first. See <https://furrr.futureverse.org/> for more details.

do_cache

Use cache system? (default = TRUE)

cache_folder

Where to save cache files? (default = yfR::yf_cachefolder_get() )

...

Other arguments passed to yf_get

Value

A data frame with financial prices from collection

Examples



df_yf <- yf_collection_get(collection = "IBOV",
                           first_date = Sys.Date() - 30,
                           last_date = Sys.Date()
)



yfR documentation built on Feb. 16, 2023, 9:47 p.m.