On Tue, 13 Jul 2010, thmsfuller...@gmail.com wrote:

Hello All,

?environmentName shows how to get the environment name. But I don't
see how to set the name in the first place. Could you tell me where to
look for the function that set the environment name?

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.

--
Brian D. Ripley,                  rip...@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-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to