Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中,如何使用$后面的变量访问数据集中的信息?_R_Variables_Dataframe_Bioconductor - Fatal编程技术网

在R中,如何使用$后面的变量访问数据集中的信息?

在R中,如何使用$后面的变量访问数据集中的信息?,r,variables,dataframe,bioconductor,R,Variables,Dataframe,Bioconductor,我用Bioconductor来研究GO术语。例如,我可以使用GOBPANCESTOR$“GO:0060412”来获取0060412的所有祖先术语。然而,我需要循环使用许多可能的术语。但是,我似乎无法让GOBPANCESTOR$接受$之后的变量 > GOBPANCESTOR$"GO:0060412" [1] "GO:0003007" "GO:0003205" "GO:0003206" "GO:0003231" "GO:0003279" "GO:0003281" "GO:00072

我用Bioconductor来研究GO术语。例如,我可以使用GOBPANCESTOR$“GO:0060412”来获取0060412的所有祖先术语。然而,我需要循环使用许多可能的术语。但是,我似乎无法让GOBPANCESTOR$接受$之后的变量

 > GOBPANCESTOR$"GO:0060412"
 [1] "GO:0003007" "GO:0003205" "GO:0003206" "GO:0003231" "GO:0003279"     "GO:0003281" "GO:0007275" "GO:0009653" "GO:0009887" "GO:0007507" "GO:0008150"
[12] "GO:0032501" "GO:0032502" "GO:0044699" "GO:0044707" "GO:0044767" "GO:0048513" "GO:0048731" "GO:0048856" "GO:0060411" "GO:0072358" "GO:0072359"
[23] "all"  
但是

> mygoterm <- "GO:0060412"
> GOBPANCESTOR$mygoterm

 NULL
>mygoterm GOBPANCESTOR$mygoterm
无效的
还尝试使用粘贴,但没有效果。我觉得我一定是误解了R的工作方式


谢谢你的帮助

你没有。你用[]代替。哦,天哪……我觉得自己像个白痴。谢谢你,解决了我的问题。