I have a large data frame that Im working with, the first few lines are as follows:
Assay Genotype Sample Result
1 001 G 1 0
2 001 A 2 1
3 001 G 3 0
4 001 NA 1 NA
5 002 T 1 0
6 002 G 2 1
7 002 T 2 0
8 002 T 4 0
9 003 NA 1 NA
In total I'll be working with 2000 samples and 168 Assays for each sample.
Id like to extract the lines where I have multiple entries with both the same Assay and Sample. I want the resulting data to be in a data frame containing all of the duplicate entries, sorted such that the duplicates are next to each other. From the example above the result would look like this:
Assay Genotype Sample Result
1 001 G 1 0
4 001 NA 1 NA
6 002 G 2 1
7 002 T 2 0