On Nov 24, 2012, at 4:58 AM, frespider wrote:



HI A.k,

I need one more question, if you can answer it please

M <- matrix(sample(1:8000),nrow=100)
colnames(M)<- paste("Col",1:ncol(M),sep="")
apply(M,2,function(x) c(Min=min(x),"1st Qu" =quantile(x, 0.25,names=FALSE),
                       Range = range(x),
                       Median = quantile(x, 0.5, names=FALSE),
                       Mean= mean(x),Std=sd(x),
                       "3rd Qu" = quantile(x,0.75,names=FALSE),
                       IQR=IQR(x),Max = max(x)))

why I get two range . isn't range mean the different between the max and min

If you want the "span" (what you are calling the range) of the range (min and max) you can do this:

myRange = diff(range(x))

--
David




David Winsemius, MD
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to