Houston, we still have a problem.... It works fine till the four lines, hcdif = Hi(data)-Cl(data) datasmv=filter(Cl(data),rep(1/7,7), sides=1) datalmv=filter(Cl(data),rep(1/21,21), sides=1) data$smv<-datasmv However, for
data$lmv<-datalmv Warning message: In data$lmv <- datalmv : Coercing LHS to a list SMV gets added to the CSV as another column but once I try to add the LMV, I get the above mentioned error Same if i try and add hcdif using data$HminusC<-hcdif ________________________________ From: rex <[email protected]> To: r-sig-finance <[email protected]> Sent: Thursday, September 27, 2012 12:36 PM Subject: Re: [R-SIG-Finance] Coercing LHS to a list >Now one more error to sort .... > >library(quantmod) >getSymbols("INFY.BO", from="2008-01-01") >data<-INFY.BO >#Add the SMA/LMA >h=data[,4] <---- this is close, not high >c=data[,5] <---- this is volume, not close >hcdif=h-c I'd replace 3 the lines above with: hcdif = Hi(data)-Cl(data) >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 Do you want: datasmv=filter(Cl(data),rep(1/7,7), sides=1) datalmv=filter(Cl(data),rep(1/21,21), sides=1) HTH, -rex -- Change is inevitable, except from a vending machine. _______________________________________________ [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. [[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.
