Fill all missing values in a vector with the previous value if it is known.
fill_missing_previous(x, min_known_n = NULL, min_known_p = NULL)
The vector to fill
numeric value: the minimum number of not-missing values
numeric value between 0 and 1: the minimum fraction of not-missing values
a filled vector
fill_missing_previous(c(1, 2, NA))#>  1 2 2fill_missing_previous(c(NA, 1, 2, NA))#>  NA 1 2 2