Description Usage Arguments Value See Also Examples
Fill missing values in a time series (or in a column of a longitudional data set) with the next observation carry back method.
1 |
indicator |
A tibble created by |
A tibble updated with the values carried back.
Other approximation functions:
impute_indicators()
,
na_approx()
,
na_locf()
1 2 3 4 5 6 7 8 9 10 11 12 | {
example_df <- data.frame (
time = rep(as.Date (paste0(2018:2021, "-01-01")),3),
geo = c( rep("NL", 4), rep("BE", 4), rep("LU", 4)),
value = c(10,11, NA_real_, 12, NA_real_, 21,22,23, 5,6,7,NA_real_),
frequency = rep("A", 12)
)
example_df$method <- ifelse(is.na(example_df$value), "missing", "actual")
example_df$estimate <- example_df$method
na_nocb ( example_df )
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.