I am extremely new to R and am trying to merge two data.fields in R that have slightly different column names.
For example: - The column names for data.field 1 are "Sample.1.a" "Sample.2.a" "Sample.3.a" "Sample.4.a"... etc for 300 samples - The column names for data.field 2 are "Sample.1" "Sample.2" "Sample.4" "Sample 5"... etc for 305 samples.
I need to find a way to find the intersection between these two data.fields and need to remove samples that do not appear in both data.fields. Any advice? As far as I can tell, the merge() function will not work for this.
I apologize if this first post I have made is improperly formatted. I just need help.