GetSP500Stocks: Function to download the current components of the SP500...

Description Usage Arguments Value Examples

View source: R/GetSP500Stocks.R

Description

This function scrapes the stocks that constitute the SP500 index from the wikipedia page at https://en.wikipedia.org/wiki/List_of_S

Usage

1
2
3
4
GetSP500Stocks(
  do.cache = TRUE,
  cache.folder = file.path(tempdir(), "BGS_Cache")
)

Arguments

do.cache

Use cache system? (default = TRUE)

cache.folder

Where to save cache files? (default = file.path(tempdir(), 'BGS_Cache') )

Value

A dataframe that includes a column with the list of tickers of companies that belong to the SP500 index

Examples

1
2
3
4
5
## Not run: 
df.SP500 <- GetSP500Stocks()
print(df.SP500$tickers)

## End(Not run)

BatchGetSymbols documentation built on Jan. 13, 2021, 5:17 p.m.