last_not_na | R Documentation |
Replaces NA in a vector with the previous most non NA value. If no preceding non NA values then keep as NA.
last_not_na(x)
x |
vector |
vector with NAs replaced with preceding value
last_not_na(c(NA,1, NA, 1:3, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.