Good morning scholars!
Please kindly guide on how to calculate daily simple returns and simple log returns in R. I have calculated these values in other statistical packages successfully but the task insisted that it must be calculated in R studio. Please identify and detect any possible errors in my code. Below are my codes for the task:
rm(list = ls(all = TRUE)); graphics.off(); cat("\014")
#Required libraries
library(quantmod)
library(psych)
library(xts)
#DAILY OPEN PRICE DATASETS with OPEN, CLOSE, HIGH and LOW
getSymbols("^GSPC", src="yahoo", from = "2018-01-01",to="2020-12-31")
SPY1