yfR and BatchGetSymbols
Marcelo Perlin
2024-11-21
Source:vignettes/diff-batchgetsymbols.Rmd
diff-batchgetsymbols.Rmd
Differences from BatchGetSymbols
Package BatchgetSymbols
was developed back in 2016, with
many bad structural choices from my part. Since then, I learned more
about R and its ecosystem, resulting in better and more maintainable
code. However, it is impossible to keep compatibility with the changes I
wanted to make, which is why I decided to develop a new (and fresh)
package.
Here are the main differences between yfR
(new) and
BatchGetSymbols
(old):
All input arguments are now formatted as “snake_case” and not “dot.case”. For example, the argument for the first date of data importation in
yfR::yf_get()
isfirst_date
, and notfirst.date
, as used inBatchGetSymbols::BatchGetSymbols
.A new feature called “collection”, which allows for easy download of a collection of tickers. For example, you can download price data for all components of the SP500 by simply calling
yfR::yf_collection_get("SP500")
.All function have been renamed for a common API notation. For example,
BatchGetSymbols::BatchGetSymbols
is nowyfR::yf_get()
. Likewise, the function for fetching collections isyfR::yf_collection_get()
.The output of
yfR::yf_get()
is always a tibble with the price data (and not a list as inBatchGetSymbols::BatchGetSymbols
). If one wants the tibble with a summary of the importing process, it is available as an attribute of the output (see functionbase::attributes
)New and prettier status messages using package
cli