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)
From: Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
Date: Thu 11 Nov 1999 - 21:46:35 EST


Message-ID: <x266z92quc.fsf@blueberry.kubism.ku.dk>

maechler@stat.math.ethz.ch writes:

> I'm pro fixing this.
> and I'll do if I don't hear protests..

Protest!...

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

Notice the "Month" in the output.

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

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

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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