[R-gregmisc-users] SF.net SVN: r-gregmisc:[1536] trunk/gdata/R/ls.funs.R
Brought to you by:
warnes
From: <wa...@us...> - 2012-06-05 19:07:59
|
Revision: 1536 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1536&view=rev Author: warnes Date: 2012-06-05 19:07:53 +0000 (Tue, 05 Jun 2012) Log Message: ----------- Fix error in ls.funs() that occurs when there are no objects in the environment. Modified Paths: -------------- trunk/gdata/R/ls.funs.R Modified: trunk/gdata/R/ls.funs.R =================================================================== --- trunk/gdata/R/ls.funs.R 2012-06-05 18:36:05 UTC (rev 1535) +++ trunk/gdata/R/ls.funs.R 2012-06-05 19:07:53 UTC (rev 1536) @@ -3,7 +3,12 @@ mycall <- match.call() mycall[[1]] <- as.name("ls") nameList <- eval.parent(mycall) - funcFlags <- sapply( nameList, function(x) is.function(get(x)) ) - nameList[funcFlags] + if(length(nameList)>0) + { + funcFlags <- sapply( nameList, function(x) is.function(get(x)) ) + return(nameList[funcFlags]) + } + else + return( list() ) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |