I have a table with many samples. I would like to have Positive & Negative controls at the top of the table, but need help figuring out the most straighforward way to do this.
Here is a minimal example dataframe:
df = data.frame(structure(list(Well = c("A1", "A2", "B1", "B2"),
Sample = c("Asample 2", "Positive control", "Asample 1", "Negative control"))))
The task:
- Positive & negative controls at the top of the table.
- The rest of the table arranged by
welland NOT thesamplename. - Keep in mind that positive & negative controls are always named like this, but could have any random well id in real life situation, whereas sample names and well ids can vary.
The desired output:
well sample
<chr> <chr>
1 A2 Positive control
2 B2 Negative control
3 A1 Asample 2
4 B1 Asample 1