These two functions will list the functions and variables
respectively:

ls.funs <- 
function(env=sys.frame(-1))unlist(lapply(ls(env=env),function(x)if(is.function(get(x)))x))

ls.vars <- 
function(env=sys.frame(-1))unlist(lapply(ls(env=env),function(x)if(!is.function(get(x)))x))


To use:

ls.funs()
ls.vars()


Date:   Sat, 19 Jun 2004 22:59:57 -0400 
From:   Shin <[EMAIL PROTECTED]>
To:   R Help <[EMAIL PROTECTED]> 
Subject:   [R] A way to list only variables or functions? 

 
I am curious if there is any way to list only variables or functions in
current environment, rather than listing all objects? Thanks.

-- 
Daehyok Shin (Peter)
Geography Department
Univ. of North Carolina-Chapel Hill

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to