R:进入“内部"环境 [英] R: getting "inside" environments

查看:88
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆