You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submitted by: Koert Kuipers
Assigned to: Nobody R-Forge link
xts version 0.8-0 on R 2.12.0
library(xts)
Loading required package: zoo
Warning message:
package 'xts' was built under R version 2.12.2
x <- xts(c(1, 2, NA, NA, 5, 6, NA, NA), Sys.Date() + 1 : 8)
na.locf(x, maxgap = 1)
[,1]
2011-03-09 1
2011-03-10 2
2011-03-11 NA
2011-03-12 NA
2011-03-13 5
2011-03-14 6
2011-03-15 6
2011-03-16 6
na.locf(as.zoo(x), maxgap = 1)
2011-03-09 2011-03-10 2011-03-11 2011-03-12 2011-03-13 2011-03-14
1 2 NA NA 5 6
na.locf(as.zoo(x), na.rm = FALSE, maxgap = 1)
2011-03-09 1
2011-03-10 2
2011-03-11 NA
2011-03-12 NA
2011-03-13 5
2011-03-14 6
2011-03-15 NA
2011-03-16 NA
na.locf.xts should not replace the two two trailing NAs.
na.locf.zoo has unexpected behavior as well: it removes the trailing NAs, while the documentation says it will only remove leading NAs....
Best, Koert
Followups:
Date: 2011-03-08 17:47
Sender: Jeff Ryan
Patched as of rev 575 (xts 0.8-0.1)
Submitted by: Koert Kuipers
Assigned to: Nobody
R-Forge link
xts version 0.8-0 on R 2.12.0
2011-03-09 1
2011-03-10 2
2011-03-11 NA
2011-03-12 NA
2011-03-13 5
2011-03-14 6
2011-03-15 NA
2011-03-16 NA
na.locf.xts should not replace the two two trailing NAs.
na.locf.zoo has unexpected behavior as well: it removes the trailing NAs, while the documentation says it will only remove leading NAs....
Best, Koert
Followups:
Date: 2011-03-08 17:47
Sender: Jeff Ryan
Patched as of rev 575 (xts 0.8-0.1)
Jeff
The text was updated successfully, but these errors were encountered: