Re: [Rd] Package "datasets" not exporting anything on a recent R-2.15.1-patched

From: Prof Brian Ripley <>
Date: Sun, 26 Aug 2012 18:03:29 +0100

On 26/08/2012 17:25, Laurent Gautier wrote:
> Hi,

> I just stumbled on the following apparent oddity: the package "datasets"
> does not appear to export anything out of its namespace:
> > ns_datasets <- getNamespace('datasets')
> > getNamespaceExports(ns_datasets)
> character(0)
> Not the case with other packages (example here with "utils"):
> > ns_utils <- getNamespace('utils')
> > head(getNamespaceExports(ns_utils))
> [1] "?" ".DollarNames" "adist" "alarm" "apropos"
> [6] "aregexec"
> Is this a temporary glitch, or is there something new and specific to
> "datasets" ?

Not new, been so since R 2.14.0.

The package contains no R code: the only reason it has a namespace is that since 2.14.0 all packages must have one.

There are other data-only packages, but not in base R.

Lazy-loaded data has not been part of the namespace for a long time: they are directly in the package's environment. The reason is the namespace scoping rules: if the package's datasets were in its namespace, they would be found before any other dataset of that name by the package's R functions.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Sun 26 Aug 2012 - 17:06:01 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Sun 26 Aug 2012 - 17:30:40 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive