# the file is an 'xts' data file
# if 'xts' is not installed you can still do this
tsplot(djia, ncolm=2, col=2:6) # no dates
tsplot(timex(djia), djia, ncolm=2, col=2:6) # dates
# differencing (on its own) loses an obs
return = diff(log(djia[,'Close']))
tsplot(timex(djia)[-1], return, col=4, gg=TRUE, main='DJIA')
Run the code above in your browser using DataLab