Hello, I have these 4 data frames below. I want to match the entries from the column genes_brown_GO
to the entries from the column GeneSymbol
in each of the other data frames. genes_brown_GO
column is a small list present in the GeneSymbol
columns of the other data frames, so it's like I want to sort out the genes_brown_GO
column from the other data frames by rows (so keeping the <chr>
column, so the GeneSymbol
, with the <dbl>
column, so the log2FoldChange
values).
Here the sample data from 'genes_brown_GO
':
# A tibble: 159 x 1
genes_brown_GO$`genes_brown_ GO`
<chr>
1 Actr2
2 Adipor2
3 Adrm1
4 Agfg1
5 Alcam
6 Alg3
7 Anxa2
8 Aoah
9 Ap1g1
10 Apod
# ... with 149 more rows
The sample data from 'IMQvsLAL_6h_protein_coding_log2FC':
# A tibble: 16,341 x 1
IvsL_6h_readable$GeneSymbol $log2FoldChange
<chr> <dbl>
1 March1 1.34
2 Marc1 -2.03
3 March2 0.148
4 Marc2 -0.0372
5 Ackr1 2.30
6 Aldoa 0.320
7 Aldoa -1.08
8 Ankhd1 0.501
9 Arhgef2 0.593
10 Clec2d 1.25
# ... with 16,331 more rows
The sample data from 'IMQvsLAL_16h_protein_coding_log2FC':
# A tibble: 28,361 x 1
IvsL_16h_readable$GeneSymbol $log2FoldChange
<chr> <dbl>
1 Marc1 -1.23
2 March1 -1.91
3 Marc2 0.178
4 March2 -0.795
5 1700030C10Rik 0.794
6 1700030C10Rik -0.413
7 4930594M22Rik -0.659
8 4930594M22Rik -1.37
9 Actr2 0.561
10 Aldoa 1.14
# ... with 28,351 more rows
The sample data from 'IMQvsLAL_16h_protein_coding_log2FC':
A tibble: 16,341 x 1
IvsI_readable$GeneSymbol $log2FoldChange
<chr> <dbl>
1 March1 0.421
2 Marc1 -1.37
3 Marc2 -0.129
4 March2 -0.788
5 Actr2 -0.957
6 Aldoa 0.735
7 Aldoa 0.0730
8 Anxa2 -1.54
9 Ap1g1 -0.259
10 Atad3a 0.363
# ... with 16,331 more rows
This is what I tried so far by matching 'genes_brown_GO
' with each one of the above data frames (just an example):
library(dplyr)
> IvsL_6h_merged <- merge(genes_brown_GO, IMQvsLAL_6h_protein_coding_log2FC)
This is what came out:
# A tibble: 2,598,219 x 1
IvsL_6h_merged$`genes_brown_ GO` $GeneSymbol $log2FoldChange
<chr> <chr> <dbl>
1 Actr2 March1 1.34
2 Adipor2 March1 1.34
3 Adrm1 March1 1.34
4 Agfg1 March1 1.34
5 Alcam March1 1.34
6 Alg3 March1 1.34
7 Anxa2 March1 1.34
8 Aoah March1 1.34
9 Ap1g1 March1 1.34
10 Apod March1 1.34
# ... with 2,598,209 more rows
As you can see, this is not what I was expecting. How can I solve this?
Thank you so much for your willingness!