[R] Break into Parts

Liaw, Andy andy_liaw at merck.com
Fri Apr 28 14:46:01 CEST 2006

You didn't say _how_ you want the vector to be broken up,
so you get two different answers from Uwe and Gabor.  Uwe's
answer group every six elements into one group, in the order
they appear in the vector (which, BTW, can be simplified to
just sd(matrix(x, ncol=12)).  Gabor's answer put the smallest
six into one group, the next smallest six into the second
group and so on.  You'll have to decide which is the one 
you want.


From: sumanta basak
> Hi R-Experts,
> I have a vector of length 72. I want to break it into 12 
> parts and want to take standerd deviation of each group. 
> Please help me in this regard.
> Thanks,
> Sumanta.
> ---------------------------------
> 	[[alternative HTML version deleted]]
> ______________________________________________
> 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