[Rd] str() resets class for environments

From: Roger D. Peng <rpeng_at_jhsph.edu>
Date: Wed 24 Nov 2004 - 01:14:17 EST


I noticed the following today --- str() seems to remove any extra class information added to an environment.

> e <- new.env()
> class(e)

[1] "environment"
> class(e) <- c("foo", class(e))
> class(e)

[1] "foo" "environment"
> str(e)

Classes 'foo', 'environment' length 0 <environment>

> class(e)

[1] "environment"

I'm not sure if this is related to the external pointer issue mentioned in the NEWS file. Is this the intended behavior for environments? (It happens in today's R-devel also.)

> version

          _
platform i686-pc-linux-gnu

arch     i686
os       linux-gnu

system i686, linux-gnu
status
major 2
minor 0.1
year 2004
month 11
day 15
language R
>

-roger

-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Nov 24 01:51:48 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:01:41 EST