download.SP500PriceReturns {PerformanceAnalytics} | R Documentation |
This function downloads daily/monthly S & P 500 prices using get.hist.quote
for "^gspc" and calculate S & P returns using CalculateReturns
download.SP500PriceReturns(start = "1998-01-01", end = NULL, compression=c("m","d"), method=c("compound","simple"))
start |
start date in YYYY-mm-dd format, default "1998-01-01" |
end |
end date in YYYY-mm-dd format |
compression |
"m" for monthly returns and "d" for daily returns, default monthly, as passthru to get.hist.quote |
method |
"simple" or "compound" as a passthru to CalculateReturns , default compound |
matrix of simple or compound returns on the S & P 500 at the daily/monthly scale specified
Peter Carl
CalculateReturns
download.RiskFree
get.hist.quote
sp500 = download.SP500PriceReturns(start = "1996-12-31", end = "2007-01-01") class(sp500) head(sp500)