Re: [Rd] getNamespaceExports("base") error

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 15 May 2007 13:09:44 +0100 (BST)

It would seem more logical to use .BaseNamespaceEnv. Today it has the same contents as baseenv() (but a different enclosing env), but that may change.

I do wonder why you are using this: the R code clearly doesn't. For base is not a normal namespace and is automatically imported into every other namespace (or similar words, as 'import' is used in a couple of senses in the documentation).

On Tue, 15 May 2007, ml-it-r-devel_at_epigenomics.com wrote:

>
> Hi!
>
> >getNamespaceExports("base")
> Error in ls(NULL, all = TRUE) : using 'as.environment(NULL)' is defunct
>
> getNamespaceExports
> function (ns)
> {
> ns <- asNamespace(ns)
> if (isBaseNamespace(ns))
> ls(NULL, all = TRUE)
> else ls(getNamespaceInfo(ns, "exports"), all = TRUE)
> }
> <environment: namespace:base>
>
> One possible way to fix this could be to changed to e.g.
>
> if (isBaseNamespace(ns))
> ls(envir=baseenv(), all = TRUE)
>
> Observed with
> R 2.5.0 & R 2.6.0 devel (2007-05-12 r41546)
> (one has to go back to R 2.3.1 to see it working)
>
>
> Regards,
>
> Matthias
>
>
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 15 May 2007 - 12:12:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 May 2007 - 15:04:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.