Message-ID: <20120927070625.GV30886@ninja.nosyntax.net>
Date: 2012-09-27T07:06:25Z
From: rex
Subject: Coercing LHS to a list
In-Reply-To: <1348727285.41718.YahooMailNeo@web163804.mail.gq1.yahoo.com>
sean fallon <sf99167 at yahoo.com> [2012-09-26 23:27]:
>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.