Skip to content
Prev 227464 / 398500 Next

Set environment name

On Tue, 13 Jul 2010, thmsfuller066 at gmail.com wrote:

            
It is not AFAIK possible from R code.  environmentName() will give the 
name which has been assigned at C level, but names(), which would 
otherwise work, is disabled for non-vector objects.

The underlying reason is the unusual copying semantics of 
environments -- it makes little sense to allow the name to be changed.

I do wonder why you would want this: if there is a good reason then we 
could perhaps allow new.env() to set the name.  But I added 
environmentName() to be able programatically to identify system 
environments such as packages and namespaces, especially the latter.