[R] formatting output

Marc Schwartz MSchwartz at MedAnalytics.com
Tue Mar 1 03:11:46 CET 2005


On Tue, 2005-03-01 at 01:21 +0000, Gabor Grothendieck wrote:

<snip>

> Here is a slight variation of Marc's solution that avoids explicit
> setting of the row names:
> 
> R>   my.tmp <- split(warpbreaks$breaks, 
> +     list(warpbreaks$wool, warpbreaks$tension))
> R>   my.tmp <- lapply(my.tmp, quantile)
> R>   do.call("rbind", my.tmp)
>     0% 25% 50% 75% 100%
> A.L 25  26  51  54   70
> B.L 14  20  29  31   44
> A.M 12  18  21  30   36
> B.M 16  21  28  39   42
> A.H 10  18  24  28   43
> B.H 13  15  17  21   28

Gabor,

I had my head wrapped around trying to figure out a solution in a post
hoc fashion. Didn't even think of splitting the data first.

Better solution.

Thanks,

Marc




More information about the R-help mailing list