Hi R,

I have explored R archives a lot but couldn't find an efficient way of doing the following:

I want to split a vector into sets of equal sizes. Is there any inbuilt function of doing so with the option of specifying how to treat the remaining observations. For example: suppose I want to split 20 observations in 3 groups, then I also want the option to put the extra two observations into the 1st group or the last group or one in each group starting from 1st or starting from last.

I have already tried the "cut" & the "quantcut" function but of no use.
Any help will be appreciated. Note that I am looking for an R function rather than lines of code.

Regards
Utkarsh

______________________________________________
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