df <- data.frame(
x = c(1, 2, NA),
y = c("a", NA, "b"),
z = rep(NA, 3)
)
prep_hierarchical_fill(
df,
vars = c("x", "y")
)
prep_hierarchical_fill(
df,
vars = c("x", "y"),
fill = "foo"
)
prep_hierarchical_fill(
df,
vars = c("x", "y", "z"),
fill_from_left = TRUE
)
Run the code above in your browser using DataLab