Now one more error to sort ....
Enclosed is the code as well as the error
library(quantmod)
getSymbols("INFY.BO", from="2008-01-01")
data<-INFY.BO
#check data
head(data)
#Add the SMA/LMA
h=data[,4]
c=data[,5]
hcdif=h-c
data$smv=filter(data[,5],rep(1/7,7), sides=1)
data$lmv=filter(data[,5],rep(1/21,21), sides=1)
The data$smv has not error
However, for data$lmv has the following error
Warning message:
In data$lmv = filter(data[, 5], rep(1/21, 21), sides = 1) :
Coercing LHS to a list
Any ideas how to go about this???
Sean
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.