| Indice-class | R Documentation |
Class for retrieving data related to market indices from the Yahoo Finance API.
Inherits get_history() from YahooFinanceBase-class.
An R6 class object
YahooFinanceBase -> Index
indexDeprecated. Returns self$symbol.
Index$new()Create a new Index object.
Index$new(symbol = NA, index = NA, validate = TRUE)
symbolSymbol (e.g., "^NSEI").
indexDeprecated. Use symbol instead.
validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
A new Index object.
nifty_50 <- Index$new('^NSEI')
Index$set_index()Set a new index symbol.
Index$set_index(symbol = NA, index = NA, validate = TRUE)
symbolNew symbol.
indexDeprecated. Use symbol instead.
validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
indice <- Index$new('^NSEI')
indice$set_index('^NDX')
Index$clone()The objects of this class are cloneable with this method.
Index$clone(deep = FALSE)
deepWhether to make a deep clone.
Other historical data:
Ticker-class,
Tickers,
yf_download_prices(),
yf_get_index_quotes()
## ------------------------------------------------
## Method `Index$new()`
## ------------------------------------------------
## Not run:
nifty_50 <- Index$new('^NSEI')
## End(Not run)
## ------------------------------------------------
## Method `Index$set_index()`
## ------------------------------------------------
## Not run:
indice <- Index$new('^NSEI')
indice$set_index('^NDX')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.