I am pretty sure this is quite simple, but seem to have got stuck...I have two xts vectors that have been merged together, which contain numeric values and NAs.
I wo
mm$m <- "is.na<-"(rowSums(mm, na.rm = TRUE), !rowSums(!is.na(mm))) > tail(mm) # dd1 dd2 m # 2013-08-06 NA 1.3325804 1.332580 # 2013-08-07 NA 0.7726740 0.772674 # 2013-08-08 0.8158402 -0.8158402 0.000000 # 2013-08-09 NA 1.2292919 1.229292 # 2013-08-10 NA NA NA # 2013-08-11 NA 0.9334900 0.933490