stvienna wiener
2009-Jul-10 23:19 UTC
[R] Error when running the examples in plotMultiTS / QRMlib
Dear List, R ist somtimes a bit frustrating... I ran the example from http://bm2.genes.nig.ac.jp/RGM2/R_current/library/QRMlib/man/plotMultiTS.html and I get an error. Has someone an explanation for this? Thanks a lot, Steve CODE: library(R.utils) library(tseries) library(wmtsa) library(waveslim) library(brainwaver) library(timeSeries) library(QRMlib)> ?plotMultiTS > data(DJ); > Sdata <- window(DJ, from="1993-01-01", to="2000-12-31"); > #select only 4 stocks from 30-stock index: > tsSelections <- c("GE","INTC","KO","JNJ"); > Sdata <- Sdata[,tsSelections];Error in .subset(x, i, j, drop = FALSE) : object of type 'S4' is not subsettable> Zdata <- log(Sdata); > rm(Sdata); > #Plot all 4 columns on same graph: > plotMultiTS(Zdata, reference.grid=TRUE);Error: subscript out of bounds> #plot only columns 2 and 3 on the graph: > plotMultiTS(Zdata, colvec= c(2,3),reference.grid=TRUE, format="%Y-%m");Error in .subset(x, i, j, drop = FALSE) : object of type 'S4' is not subsettable 2nd question: running > plotMultiTS i find the line: "xxx = tS[, i]@Data" Why would someone name a variable "xxx"? Is this some "feature" or just poor programming?