Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
source("config/config.R")
SPDR <- readRDS(file="data/SPDR.rds")
SPDR.returns <- na.omit((SPDR / lag(SPDR, k= 1) - 1) * 100)
###########################################################################
############# Plot the underlying SPDR assets #############################
###########################################################################
nrAssets <- ncol(SPDR)
par(mfrow=c(rep(ceiling(sqrt(nrAssets)),2)))
res <- sapply(1:nrAssets, function(x) plot(time(SPDR[,x]),
coredata(SPDR[,x]), main=names(SPDR)[x],type="l",
xlab="Time",ylab="Price"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment