
Taking a vector, carry value over ('persistence')
Source:R/carry_over_values.R
carry_over_values.Rd
This function takes a value, and then replaces empty elements (NA or zero-length character values) with the last non-empty preceding element it encountered.
Examples
rock::carry_over_values(
c(
NA, NA, 3, NA, NA, 7, NA, NA
)
);
#> [1] "no_id" "no_id" "3" "3" "3" "7" "7" "7"