Asked a similar previous question but cant seem to alter the code to get the desired outcome:
my data frame is df:
date tss
2020-05-29 71
2020-05-29 60
2020-05-30 42
2020-05-31 NA
2020-06-01 95
2020-06-01 82
2020-06-02 69
2020-06-03 103
2020-06-04 49
2020-06-05 74
2020-06-05 49
2020-06-06 NA
2020-06-07 NA
2020-06-08 NA
2020-06-09 50
2020-06-10 191
2020-06-11 125
2020-06-11 126
2020-06-12 104
2020-06-12 77
Would like to move the tss scores that occur more than once (twice in the same day) into a new column where there is only one row for each date(date is classified as a date).
for example:
date tss tss2
2020-05-29 71 60
2020-05-30 42 0
2020-05-31 NA
2020-06-01 95 82
There will only ever be 2 tss entries for the same date. tried utilising group_by and pivot_wider but to no success.
thank you.