I have a dataframe that returns the following table (for example)
ID AVG SIG
5X1PK 0.2712 0.004780167
DF5TB 39.4279 59.3092
5X1PK 64.8847 0.3614
DJII2 59.6743 26.7279
DRQUW 43.8942 0.2261
DRQUU 44.0606 0.128
DRQUW 43.6278 0.1562
I am able to get the rows for one value of a column using this formula
data2 <- data1[data1$ID == ('5X1PK'),]
Suppose, I want to get all rows for the ID's (5X1PK, DRQUW, DRQUU) then the desired output that I want is
ID AVG SIG
5X1PK 0.2712 0.004780167
5X1PK 64.8847 0.3614
DRQUW 43.8942 0.2261
DRQUU 44.0606 0.128
DRQUW 43.6278 0.1562
How do I get rows for multiple values of ID in one table?