Re: [Rd] Changes to environments in R-devel

From: Prof Brian Ripley <>
Date: Fri 04 Nov 2005 - 15:08:55 GMT

As a followup, these changes have some impacts on already installed packages, most likely including all those using lazy-loading or saved images.

If you are building from a checked-out version of R you will need to trigger re-installation of the recommended packages. Unix users can do that by

    rm src/library/Recommended/*.ts

but Windows users will best do 'make distclean; make all recommended' as a clean is needed.

One way to re-install all other packages is

> have <- installed.packages(priority="NA")[,1]
> install.packages(have)

at least if you have them all in the main library tree or all in one additional tree. Doing it from within R ensures that the dependency order is maintained. If like me you have almost all CRAN packages installed that will take quite a while.

Note that re-installing binary packages under Windows and MacOS X will not be effective until the repositories have been rebuilt.

On Thu, 3 Nov 2005, Duncan Murdoch wrote:

> I've just committed some changes to R-devel which affect environments.
> Specifically:
> - using NULL as an environment is now deprecated: use baseenv()
> instead. (baseenv() is already available in R 2.2.0, where it returns
> NULL. For most purposes it retains the same meaning in R-devel.) If you
> do use NULL, it will be converted to baseenv(), and a warning printed.
> For example:
> > f <- function(x) 1
> > environment(f) <- NULL
> Warning message:
> use of NULL environment is deprecated
> > environment(f)
> <environment: base>
> There may be some places where I've missed putting the conversion in
> place, and use of NULL will cause an error; please let me know if you
> find any of those. The intention is that NULL will be usable with
> warnings through to the end of the 2.3.x releases.
> - baseenv() is no longer its own parent. Its parent is an empty
> environment, available as emptyenv().
> - You can now create your own environment with emptyenv() as its
> parent. Searches for variables in such an environment will not
> automatically proceed to baseenv(), as searches do in current R releases.
> Duncan Murdoch
> ______________________________________________
> mailing list

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 Sat Nov 05 02:20:05 2005

This archive was generated by hypermail 2.1.8 : Fri 04 Nov 2005 - 16:21:17 GMT