[Sciviews-commits] r273 - pkg/svMisc/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 10 18:52:55 CEST 2010


Author: prezez
Date: 2010-05-10 18:52:55 +0200 (Mon, 10 May 2010)
New Revision: 273

Modified:
   pkg/svMisc/R/objList.R
Log:
Small change to svMisc:objList, now it can list contents of an object of mode "environment".

Modified: pkg/svMisc/R/objList.R
===================================================================
--- pkg/svMisc/R/objList.R	2010-05-08 20:53:48 UTC (rev 272)
+++ pkg/svMisc/R/objList.R	2010-05-10 16:52:55 UTC (rev 273)
@@ -190,12 +190,14 @@
 	if (inherits(obj, "try-error"))
 		return(NULL)
 
+	if(is.environment(obj))
+		obj <- as.list(obj)
+
 	if (mode(obj) == "S4") {
 		ret <- lsObj.S4(obj, objname)
 	} else if (is.function(obj)) {
 		ret <- lsObj.function(obj, objname)
 	} else {	# S3
-#{{
 		if (!(mode(obj) %in% c("list", "pairlist")) || length(obj) == 0)
 			return(NULL)
 
@@ -226,7 +228,6 @@
 		}))
 
 		ret <- data.frame(itemnames, fullnames, ret, stringsAsFactors = FALSE)
-#}}
 	}
 	if (!is.null(ret))
 		names(ret) <- c("Name", "Full.name", "Dims/default", "Group", "Class",



More information about the Sciviews-commits mailing list