hi I have the following code chunk. is there any way to make the mutate and different fills in fewer lines of code? basically I copy a given column and then I select the fill's direction based on the new suffix of the column.
data %>% mutate(copy_down = copy, copy_up = copy, copy_updown = copy, copy_downup = copy) %>% group_by(ID, period) %>% fill(copy_down, .direction = "down") %>% fill(copy_up, .direction = "up") %>% fill(copy_updown, .direction = "updown") %>% fill(copy_downup, .direction = "downup")
thank u <3