I have the following df called data:
ProbeID SampleID ExperimID Value
1 2747406 1 2 6.44
1 2747406 4 2 5.90
etc....
I am trying to extract the Value(s) in col 4 (data[,4]) that match for SampleID = 1 ( data[,2] = 1) and SampleID = 4 (data[,2]=4)
It is important that the values match the SampleID and get extracted together (i.e. for SampleID 1, value = 6.44 and for SampleID 4, value = 5.90). They can get separated into to new df (x and y), ideally giving me x with all the SampleID 1 values and y with all the SampleID 4 values.
I am completely stuck on this, any help is much appreciated.
The goal is to get two new dataframes say x and y to look like depicted below:
With x being:
SampleID Value
1 1 6.44
etc..
and y being:
SampleID Value
1 4 5.90
etc...
I think you should listen to mnel but if you really want to clutter your workspace up with disjoint bits of data then do this: