An obviously dumb question but I'm trying to add/subtract xts data...

>myPrediction[10]<- myPrediction[10]-myPrediction[9]
Error in NextMethod(.Generic) : replacement has length zero

>myPrediction[10,1]<- myPrediction[10,1]-myPrediction[9,1]
Error in NextMethod(.Generic) : replacement has length zero

> myPrediction[10,1] <- (myPrediction[10,1]-myPrediction[9,1])
Error in NextMethod(.Generic) : replacement has length zero

> is.xts(myPrediction)
[1] TRUE

> myPrediction[10]
Nov 2009 9854.299

> myPrediction[9]
Oct 2009 9713.752

What is my issue here?

	[[alternative HTML version deleted]]

