R-beta: losing attributes in binary ops

Gordon Maclean (maclean@stout.atd.ucar.edu)
Tue, 6 Jan 1998 18:05:02 GMT


From: maclean@stout.atd.ucar.edu (Gordon Maclean)
Date: Tue, 6 Jan 1998 18:05:02 GMT
Message-Id: <199801061805.SAA16767@ripple.atd.ucar.edu>
To: r-help@stat.math.ethz.ch
Subject: R-beta: losing attributes in binary ops

Content-MD5: KNBH2An0OAW3xuuvNlvIEQ==
Sender: owner-r-help@stat.math.ethz.ch
Precedence: bulk



Thanks to Thomas Lumley for the very quick fix of the NextMethod(.Generic)
bug.  The patch enclosed in his message to r-help fixed that problem
nicely. 

But..., I've got another one.

	x <- 1:4
	attr(x,"foo") <- "bar"	
	attributes(x < 4)

returns NULL.

The "foo" attribute has been lost in the "x < 4" operation.
The blue book says that the result of binary operations should have
the attributes of the longer operand.

Thanks,
Gordon Maclean

Nat'l Center for Atmospheric Research
Boulder CO


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._