Re: [R] Dividing objects in classes using function sample()

From: Johannes Hüsing <>
Date: Sun 03 Sep 2006 - 11:07:08 GMT

> I want to divide n objects in k classes and need an output with all
> (n+1)(n+2)/2 possibilities.

That's the "set of compositions". You may use the partitions package and proceed from there (provided the brute-force method suggested by Gabor is not viable'). mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun Sep 03 21:11:05 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:17 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.