Get latest stock market indices values and data for more than 40 world-indices, e.g., latest prices, change and percentage change.
Value
A data frame with the following columns:
- symbol
character- Ticker symbol of the index, aka world indices (e.g.,'^GSPC'for S&P 500).- name
character- Full name of the index (e.g., "S&P 500").- price
numeric- Current value of the index (USD).- change
numeric- Absolute change in index value since the last closing of the exchange place.- change_percent
numeric- Percentage change in index value since the last closing of the exchange place.- volume
numeric- The total trading volume of the index components.- currency
character- Currency associated with the world-indice, i.e. 'USD'.
Details
Return a data.frame with additional attributes:
- n.currencies
integer- Number of unique currencies in thedata.frame.- currencies
character- A vector of currency symbols in thedata.frame(e.g.,"BTC","ETH","USD").- exchange
character- A vector of exchange pairs (e.g.,"BTC => USD"). If not applicable,NULL(no entry).- date.fetch
Date- The date when the data was retrieved, set usingSys.Date().- crypto
logical-TRUEif cryptocurrencies are present, otherwiseFALSE.- date.begin
POSIXct- The oldest observation in the dataset.- date.end
POSIXct- The most recent observation in the dataset.- date.dif
numeric- The number of seconds between date.begin and date.end, equivalent ofdifftimevalue.
See also
For more details on the 'last_' family of functions see the help vignette:
vignette("last_family", package = "financr")
Examples
if (FALSE) { # \dontrun{
indices <- last_indices()
head(indices)
} # }
