From pdalgd at gmail.com  Wed Apr 27 20:56:17 2011
From: pdalgd at gmail.com (peter dalgaard)
Date: Wed, 27 Apr 2011 20:56:17 +0200
Subject: [Rd] median and data frames
In-Reply-To: <4DB85617.8090706@pburns.seanet.com>
References: <4DB85617.8090706@pburns.seanet.com>
Message-ID: <5B2235D4-FB9D-4692-8A68-AE5DDC0E2819@gmail.com>


On Apr 27, 2011, at 19:44 , Patrick Burns wrote:

> I would think a method in analogy to
> 'mean.data.frame' would be a logical choice.
> But I'm presuming there might be an argument
> against that or 'median.data.frame' would already
> exist.

Only if someone had a better plan. As you are probably well aware, what you are currently seeing is a rather exquisite mashup of methods getting applied to objects they shouldn't be applied to. Some curious effects are revealed, e.g. this little beauty:

> sort(df3.3)
Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) : 
  undefined columns selected
> names(df3.3)<-NULL
> sort(df3.3)
  NA NA NA   NA   NA   NA   NA   NA   NA
1  1  7 10 NULL NULL NULL NULL NULL NULL
2  2  8 11 <NA> <NA> <NA> <NA> <NA> <NA>
3  3  9 12 <NA> <NA> <NA> <NA> <NA> <NA>
Warning message:
In format.data.frame(x, digits = digits, na.encode = FALSE) :
  corrupt data frame: columns will be truncated or padded with NAs


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] median and data frames
peter dalgaard