carry_forward | R Documentation |
Carry non-NA values forward, replacing NAs
carry_forward(x)
x |
a vector |
Similar to na.locf
in package zoo
carry_forward(c(1, NA, 2, 3, NA, 5, 6, NA)) carry_forward(c(NA, NA, NA, 1, NA, 2, 3, NA, 5, 6, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.