tapply not simplifying to vector? (PR#320)
maechler@stat.math.ethz.ch
maechler@stat.math.ethz.ch
Thu, 11 Nov 1999 16:49:08 +0100 (MET)
>>>>> "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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._