na_locf | R Documentation |
Used to replace each NA
with the most recent non-NA
prior to
it. locf
is a simple wrapper for zoo::na.locf
.
na_locf(x, na.rm = FALSE)
x |
Input vector. |
na.rm |
Should leading NAs be removed? Default is |
Vector of same data type and length of x
.
Stuart K. Grange
## Not run:
# Push observations forwards, in a data frame
data_income$income_chunk <- na_locf(data_income$income_chunk)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.