I have 6 data frames with 2 columns each for "id" and "value" and differing number of rows. They are labeled p1, p2....p6 and look like this
id value_p1
Jane C 9.713457e-01
Claire K 1.260160e-01
Brett F 4.933005e-0
Jen S 0.56
I now have a character vector that includes the intersect of names across all 6 data sets called id_ intersect:
c("Jane C", "Claire K","Brett F")
I now want to create a new data frame that has is a subset of only the sections in each data frame that contain id_intersect and keeps the values for the intersecting ids in each data frame.
id value_p1 value_p2.............value_p6
Jane C 9.713457e-01 0.87 .098
Claire K 1.260160e-01 0.89 .005
Brett F 4.933005e-0 0.002 .035
I'm really stuck on this and I'm pretty new to R so any help is much appreciated. Thanks.