R:进入“内部"环境 [英] R: getting "inside" environments
本文介绍了R:进入“内部"环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出一个environment
对象e
:
> e
<environment: 0x10f0a6e98>
> class(e)
[1] "environment"
如何访问环境中的变量?
How do you access the variables inside the environment?
以防万一您感到好奇,我发现自己使用了这个environment
对象.我没做,是用Bioconductor的包装做的.您也可以使用以下命令来做到这一点:
Just in case you're curious, I have found myself with this environment
object. I didn't make it, a package in Bioconductor made it. You can make it, too, using these commands:
library('GEOquery')
eset <- getGEO("GSE4142")[[1]]
e <- assayData(eset)
推荐答案
ls(e)
为您提供环境中对象的名称,而e$name_of_object
为您提供指定的对象(或e[["a"]]
或get("a",e)
).
ls(e)
gives you names of objects in the environment and e$name_of_object
gives you specified object (or e[["a"]]
, or get("a",e)
).
这篇关于R:进入“内部"环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文