First column with missing values replaced
MissingReplaceFirst.Rd
The first column is returned with missing values sequentially replaced with values from the other columns
Examples
a <- data.frame(x = c("yes", "", "no", ""), y = c("", "ok", "ok", ""), z = "z")
print(a)
#> x y z
#> 1 yes z
#> 2 ok z
#> 3 no ok z
#> 4 z
MissingReplaceFirst(a)
#> [1] "yes" "" "no" ""
MissingReplaceFirst(a, "")
#> [1] "yes" "ok" "no" "z"
MissingReplaceFirst(a, c("", "yes"))
#> [1] "z" "ok" "no" "z"
a[3, 1] <- NA
MissingReplaceFirst(a)
#> [1] "yes" "" "ok" ""