Replace NA with previous row value - fill()

PHOTO EMBED

Thu Jun 02 2022 07:35:31 GMT+0000 (Coordinated Universal Time)

Saved by @Treenose #r #tidyr

df %>% 
  # Impute/fill the column
  fill(col_name, .direction = "up") # .direction can be "up" or "down"
content_copyCOPY