A data.frame contains 2 columns with values. Each hour both columns contain a value and a NA, but never two values.
I'm looking for a way the merge two rows that have the same hour-day-month-year combination. Example:
# before
col1 col2 hour day month year
3 NA 1 3 2 2018
NA 4 1 3 2 2018
#after
col1 col2 hour day month year
3 4 1 3 2 2018
I tried using methods form the plyr
library (ddply, paste) and group by the date
columns, but I can't get my head around it.