Learn R Programming

sp500SlidingWindow (version 0.1.0)

SP500: Daily S&P 500 data from Jan 3, 1950 to present

Description

The "usual" S&P 500 index, without dividends reinvested.

Usage

SP500(tr = FALSE)

Arguments

tr
(bool) choose Total Return (tr=TRUE) or not (default tr=FALSE) Total Return data is available only from 1988; non-dividend-reinvested data is available from 1950.

Value

A data.frame with the daily data

Details

The columns of the data.frame returned
  • Date
  • Open
  • High
  • Low
  • Close
  • Volume
  • Adj.Close

References

Yahoo Finance

Examples

Run this code
sp500_idx <- SP500()
head(sp500_idx)
tail(sp500_idx)

Run the code above in your browser using DataLab