从R中的表中筛选出条目

从R中的表中筛选出条目,r,filter,overlap,R,Filter,Overlap,我正在分析R中的一个表,它有5列:name、seed、weight、priority和rank(让我们称这个变量为fulltable) 我还使用以下方法从另一个表中隔离了一列(“名称”): candidates <- othertable$name 候选者如果我理解正确,您可能会对以下内容感兴趣: subdata <- fulldata[match(candidates, fulldata$name),] 并要提取以下名称: > candidates [1] "max"

我正在分析R中的一个表,它有5列:name、seed、weight、priority和rank(让我们称这个变量为fulltable)

我还使用以下方法从另一个表中隔离了一列(“名称”):

candidates <- othertable$name 

候选者如果我理解正确,您可能会对以下内容感兴趣:

subdata <- fulldata[match(candidates, fulldata$name),]
并要提取以下名称:

> candidates
[1] "max"   "micha" "manny"
然后,以下代码行将生成:

fulltable[match(candidates, fulltable$Namen),]
  Namen Value1 Value2
1   max      1      1
4 micha      4      4
7 manny      7      7
fulltable[match(candidates, fulltable$Namen),]
  Namen Value1 Value2
1   max      1      1
4 micha      4      4
7 manny      7      7