[R-gregmisc-users] SF.net SVN: r-gregmisc:[1531] trunk/gdata
Brought to you by:
warnes
From: <wa...@us...> - 2012-05-04 19:39:30
|
Revision: 1531 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1531&view=rev Author: warnes Date: 2012-05-04 19:39:23 +0000 (Fri, 04 May 2012) Log Message: ----------- Add ls.funs() to show functions defined in the specified environment. Modified Paths: -------------- trunk/gdata/NAMESPACE Added Paths: ----------- trunk/gdata/R/ls.funs.R trunk/gdata/man/ls.funs.Rd Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2012-05-04 19:38:20 UTC (rev 1530) +++ trunk/gdata/NAMESPACE 2012-05-04 19:39:23 UTC (rev 1531) @@ -18,6 +18,7 @@ is.what, keep, ll, + ls.funs, lowerTriangle, "lowerTriangle<-", matchcols, Added: trunk/gdata/R/ls.funs.R =================================================================== --- trunk/gdata/R/ls.funs.R (rev 0) +++ trunk/gdata/R/ls.funs.R 2012-05-04 19:39:23 UTC (rev 1531) @@ -0,0 +1,9 @@ +ls.funs <- function (...) + { + mycall <- match.call() + mycall[[1]] <- as.name("ls") + nameList <- eval.parent(mycall) + funcFlags <- sapply( nameList, function(x) is.function(get(x)) ) + nameList[funcFlags] + } + Added: trunk/gdata/man/ls.funs.Rd =================================================================== --- trunk/gdata/man/ls.funs.Rd (rev 0) +++ trunk/gdata/man/ls.funs.Rd 2012-05-04 19:39:23 UTC (rev 1531) @@ -0,0 +1,38 @@ +\name{ls.funs} +\alias{ls.funs} +\title{List function objects} +\description{ + Return a character vector giving the names of function objects in the + specified environment. +} +\usage{ +ls.funs(...) +} +\arguments{ + \item{\dots}{Arguments passed to \code{ls}. See the help for + \code{\link[base]{ls}} for details.} +} +\details{ + This function calls \code{ls} and then returns a character vector + containing only the names of only function objects. +} +\value{ + character vector +} +\author{ + Gregory R. Warnes \email{gr...@wa...} +} +\seealso{ + \code{\link[base]{ls}}, \code{\link[base]{is.function}} +} +\examples{ +## List functions defined in the global environment: +ls.funs() + +## List functions available in the base package: +ls.funs("package:base") +} +% Add one or more standard keywords, see file 'KEYWORDS' in the +% R documentation directory. +\keyword{misc} +\keyword{environment} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |