[R] Summary()

Liaw, Andy andy_liaw at merck.com
Thu Mar 2 22:32:47 CET 2006


Probably something like this:

> x <- as.data.frame(matrix(rnorm(27 * 5), 27, 5))
> sapply(x, quantile, seq(0, 1, .1))
              V1         V2         V3         V4           V5
0%   -3.18125816 -2.3857797 -1.0564583 -2.5085757 -2.142863890
10%  -1.63832807 -1.3854193 -0.7863538 -2.0054480 -1.308758065
20%  -0.55663305 -0.9820594 -0.5997770 -0.8506803 -0.855000253
30%  -0.24216894 -0.6497351 -0.4301487 -0.5292818 -0.685654756
40%  -0.18417030 -0.3367184 -0.3249491 -0.2804804 -0.552243583
50%  -0.01245975 -0.1686330 -0.2490444 -0.1474143 -0.374655382
60%   0.10358080  0.1360502  0.1102148  0.2109845 -0.006060502
70%   0.52499224  0.3635301  0.3328593  0.4300751  0.186768725
80%   1.27043728  0.6718734  0.6026165  0.9356643  0.643105330
90%   1.77792321  1.3059572  0.8323459  1.3301074  1.398859959
100%  2.38227909  2.5356611  2.0936289  1.9094287  2.181349090

HTH,
Andy

From: Dan Chan
> 
> Hi,
> 
> I have a dataframe(FireDanger) that contains weather data (T, RH, WS,
> etc) measured at 27 stations. I want to do a quantile summary 
> for each variable at each station.  
> 
> quantile(FireDanger$RH, probs=seq(0,1,0.1), na.rm=T)
> summary(FireDanger) are close, but not quite.  
> 
> Is there a single command to get this done? 
> 
> Thank you.   
> 
> Daniel Chan
> Meteorologist
> Georgia Forestry Commission
> P O Box 819
> Macon, GA 
> 31202
> Tel: 478-751-3508
> Fax: 478-751-3465
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list