I have transposed and populated a data frame which now looks like this:
Now I am trying to overwrite all of the values in columns Signal1 and Signal 2 in upward direction by grouping them by ID and Date simultaneously. All of the previous rows should be populated by the last value for a given group. The output should look like this:
I tried to approach the problem with dplyr but not sure how to handle it:
df %>% group_by(ID, Date) %>% mutate (...)
Have to perform this operation on many more columns (Signal1 - Signal 30) so hopefully an universal solution is available.