[R] exaustive subgrouping or combination

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Jun 28 02:00:01 CEST 2007


On Wed, 27 Jun 2007, Waverley wrote:

> Dear Colleagues,
>
> I am looking for a package or previous implemented R to subgroup and
> exaustively divide a vector of squence into 2 groups.
>
> For example:
>
> 1, 2, 3, 4
>
> I want to have a group of
> 1, (2,3,4)
> (1,2), (3,4)
> (1,3), (2,4)
> (1,4), (2,3)
> (1,2,3), 4
> (2,3), (1,4)
> ...
>
> Can someone help me as how to implement this?

help.search("combinations")
?combn

Have you read the posting guide mentioned at the bottom of
each message on the list?

> I get some imaginary problem
> when the sequence becomes large.
>
> Thanks much in advance.
>
> --
> Waverley @ Palo Alto
>
> 	[[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
> and provide commented, minimal, self-contained, reproducible code.
>

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k



More information about the R-help mailing list