JFill | R Documentation |
Fill "bad" values in a vector with the most recent "good" values
JFill(x, badValues = is.na(x), indices = FALSE)
x |
Vector to be filled |
badValues |
Logical vector identifying the "bad" values in 'x', i.e. the values to be replaced |
indices |
If TRUE, return indices into 'x', otherwise values from 'x'. |
description Either a vector of indices into 'x' (when 'returnIndices' is 'TRUE'), or 'x' with bad values replaced by the most recent good value.
JFill(c(NA, 1, 2, 3, NA, 4, NA, NA))
## [1] NA 1 2 3 3 4 4 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.