[Rd] Feature request: names(someEnv) same as ls(someEnv)

Seth Falcon sfalcon at fhcrc.org
Sun Oct 15 20:48:45 CEST 2006


Hi,

I would be nice if names() returned the equivalent of ls() for
environments.

--- a/src/main/attrib.c
+++ b/src/main/attrib.c
@@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call
     s = CAR(args);
     if (isVector(s) || isList(s) || isLanguage(s))
        return getAttrib(s, R_NamesSymbol);
+    if (isEnvironment(s))
+        return R_lsInternal(s, 0);
     return R_NilValue;
 }


+ seth

--
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org




More information about the R-devel mailing list