获取R全局环境中加载的函数列表 [英] Get the list of functions loaded in R's global environment

查看:122
本文介绍了获取R全局环境中加载的函数列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:




我想从R获取环境中加载的函数列表。

我知道 ls(),它给出了对象列表加载。但是有些对象不是函数。

我想从函数中清除我的env,而不是从其他对象(矩阵,数组等)中清除我的env,这些对象包含我不希望丢失的结果。 p>

有什么想法?

参见?lsf .str

  X < -  lsf.str()
as.vector X)#仅用于打印目的,你可以使用rm()中的向量
rm(list = X)


Possible Duplicate:
Is there a way to get a vector with the name of all functions that one could use in R?

Hi

I would like to get from R the list of functions loaded in the environment.
I know ls() that gives the list of objects loaded. But some objects are not functions.
I would like to clean my env from the functions but not from the other objects (matrices, array etc) that contain some of my result that dont want to lose.

Any idea?

解决方案

See ?lsf.str

X <- lsf.str()
as.vector(X) # just for printing purposes, you can use the vector in rm()
rm(list=X)

这篇关于获取R全局环境中加载的函数列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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