nalocf | R Documentation |
This is basically a wrapper around na.locf
from the xts package. It avoids the column-by-column copying. Usefull if there are many columns in the xts object.
nalocf(x, loop = FALSE, ...)
x |
an xts object |
loop |
logical. Should the operation be performed as a loop (slower but maybe better for RAM management) |
... |
further arguments, e.g. na.rm; see |
Returns an xts object
Simon Frey
data(runoff)
# add some NAs
runoff[2,] <- NA
index(runoff)[2] <- NA
a <- nalocf(runoff)
b <- na.locf(runoff)
identical(a,b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.