我有一个包含两列的数据框。我想从这些数据中提取25行,可以找到名称的矢量。
数据:
locus kDa
1 AT1G01010 49.4
2 AT1G01020 28.1
3 AT1G01030 40.3
4 AT1G01040 213.6
5 AT1G01050 24.5
6 AT1G01060 70.4
7 AT1G01070 39.8
8 AT1G01073 4.0
9 AT1G01080 32.6
10 AT1G01090 47.2
11 AT1G01100 11.2
12 AT1G01110 41.2
13 AT1G01115 4.2
14 AT1G01120 59.3
15 AT1G01130 14.0
16 AT1G01140 50.5
17 AT1G01150 39.2
18 AT1G01160 21.0
19 AT1G01170 9.1
20 AT1G01180 34.7
就像那样有30k行。
名称向量如下:
> dput(aa)
structure(c(21L, 8L, 12L, 17L, 1L, 2L, 14L, 15L, 4L, 6L, 13L,
10L, 7L, 24L, 20L, 23L, 3L, 18L, 19L, 22L, 5L, 25L, 16L, 11L,
9L), .Label = c("AT1G04810", "AT1G20200", "AT1G29150", "AT1G45000",
"AT1G53750", "AT1G64520", "AT1G75990", "AT2G20140", "AT2G20580",
"AT2G32730", "AT3G05530", "AT3G11270", "AT4G19006", "AT4G24820",
"AT4G28470", "AT4G29040", "AT4G38630", "AT5G05780", "AT5G09900",
"AT5G19990", "AT5G20000", "AT5G23540", "AT5G43010", "AT5G45620",
"AT5G58290"), class = "factor")
我想从数据框中只提取那些可以在此向量中找到的行。
我相信你可能在我放在这里的例子中找不到任何这些名字,但我相信你知道我想要做什么...... 我很确定这很容易,但是我的大脑在早上工作不正常。