Since intersect
doesn't work with dataframes, I'm trying to use subset to create a subset of dfA
with only data for which dfA
's row names match dfB
's row names. I should end up with 3000 rows because dfA
has 5000 rows and dfB
has 3000, and all of dfB
’s row names exist in dfA
’s row names.
The following just returns dfA
's column names without any data.
mysubset = subset(dfA, dfA[,0] %in% dfB[,0])