very new to R coding and I've been trying to format/merge rows in a df using group_by from dplyr. However, I'm not quite there yet.
This is a simplification of my data table. The first three entries share the same id, and the last two entries share the same id.
ID Assay1 Assay2 Assay3 Assay4 Assay5
13,12 Months,<=-65C 12 NA NA NA NA
13,12 Months,<=-65C NA 11 NA NA NA
13,12 Months,<=-65C NA NA 33 NA NA
09,06 Months,<=-65C 112 NA NA NA NA
09,06 Months,<=-65C NA 115 NA NA NA
I want to achieve the following:
ID Assay1 Assay2 Assay3 Assay4 Assay5
13,12 Months,<=-65C 12 11 33 NA NA
09,06 Months,<=-65C 112 115 NA NA NA
So that the values in AssayValueX are merged into one row per unique id. I've used group_by with summarise but I dont want a summary... I want a new df with the merged rows! If other functions are more appropriate to achieve this, please let me know.