powered by
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.
carry_over_values(x, noId = "no_id")
The vector with the carries over elements
The vector
The value to add for the first empty elements
rock::carry_over_values( c( NA, NA, 3, NA, NA, 7, NA, NA ) );
Run the code above in your browser using DataLab