R-alpha: [ ] and attributes

Ross Ihaka (ihaka@stat.auckland.ac.nz)
Thu, 30 May 1996 15:02:00 +1200


Date: Thu, 30 May 1996 15:02:00 +1200
From: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Message-Id: <199605300302.PAA05413@stat.auckland.ac.nz>
To: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Subject: R-alpha: [ ] and attributes
In-Reply-To: <96May29.141402edt.29448@mailgate.bank-banque-canada.ca>

Paul Gilbert writes:

 > In S, when a subset of a matrix is selected with [] then it seems that
 > all attributes other than $dim are removed, whereas in R the other
 > attributes are not removed (in 0.7). This is causing me some difficuly,
 > as my tframe sets an attribute to indicate time information. If
 > the attribute is not stripped then time frame information remains and
 > is no longer consistent with the data. Is it intended that attributes
 > should not be stripped in R or is this a bug?

Dimnames are also preserved, and I presume that a levels attribute is
also kept if there is one (S factors can't be dimensioned, whereas
ours can).  In principal there is no problem stripping the other
attributes.  I'll add it to the TODO list.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-