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 > as.numeric(SPY["2007-01-04"]$SPY.Adjusted) SPY.Adjusted 2007-01-03 FALSE > as.numeric(SPY["2007-01-03"]$SPY.Adjusted) > > as.numeric(SPY["2007-01-04"]$SPY.Adjusted) [1] FALSE Is this the expected behavior ? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.