[R-SIG-Finance] Computation on xts
Robert A'gata
rhelpacc at gmail.com
Sat Apr 30 05:26:38 CEST 2011
Hi,
I have the following time series in xts
> getSymbols("SBUX");
[1] "SBUX"
Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
downloaded length 53650 != reported length 200
Then I tried to compute something row-wise. In my below example, I
simple compute daily notional using close price. I want to add the
result back as a new column in my existing time series. But it doesn't
seem to work. I'm not sure if I have missed anything. Thank you.
>SBUX[,"TurnOver"] <- SBUX[,"SBUX.Close"]*SBUX[,"SBUX.Volume"]
Error in NextMethod(.Generic) : subscript out of bounds
Cheers,
Robert
More information about the R-SIG-Finance
mailing list