Re: tapply not simplifying to vector? (PR#320)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: tapply not simplifying to vector? (PR#320)
maechler@stat.math.ethz.ch
Date: Fri 12 Nov 1999 - 01:49:08 EST


Message-Id: <199911111549.QAA07201@pubhealth.ku.dk>

>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

PD> maechler@stat.math.ethz.ch writes:
>> I'm pro fixing this.
>> and I'll do if I don't hear protests..

PD> Protest!...

>> tapply(Ozone,list(Month=Month),mean,na.rm=T)
PD> Month
PD> May June July August September
PD> 23.61538 29.44444 59.11538 59.96154 31.44828

PD> Notice the "Month" in the output.

>> dput(tapply(Ozone,list(Month=Month),mean,na.rm=T))
PD> structure(c(23.6153846153846, 29.4444444444444, 59.1153846153846,
PD> 59.9615384615385, 31.4482758620690), .Dim = 5, .Dimnames = structure(list(
PD> Month = c("May", "June", "July", "August", "September")), .Names = "Month"))

PD> Notice that the Month is the tag name of the single component of the
PD> dimnames vector, it will disappear if you try coercing it to a vector.

Completely agree with your argument.
 --> I'll change the documentation

Kurt: Another (R<->S) difference for the FAQ.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:10 EST