[R] testing xts values in if command?

2014-01-29 Thread ce
Dear all , xts objects give error in if command : Error in if : missing value where TRUE/FALSE needed library(quantmod) getSymbols(SPY) SPY[2007-01-03]$SPY.Adjusted SPY[2007-01-04]$SPY.Adjusted [,1] If I use as.numeric function it works : SPY[2007-01-03]$SPY.Adjusted

Re: [R] testing xts values in if command?

2014-01-29 Thread Joshua Ulrich
On Wed, Jan 29, 2014 at 1:25 PM, ce zadi...@excite.com wrote: Dear all , xts objects give error in if command : Error in if : missing value where TRUE/FALSE needed library(quantmod) getSymbols(SPY) SPY[2007-01-03]$SPY.Adjusted SPY[2007-01-04]$SPY.Adjusted [,1] If I use