Re: [R] Optimal Code for subset of Integer Sets

2011-07-26 Thread David Reiner
July 26, 2011 5:14 AM To: r-help@r-project.org Subject: [R] Optimal Code for subset of Integer Sets Hi, I wanted to know if there existed an good implementation in R of the following classical subset Integers : $P_{n,m} = {k_1, \ldots, k_m \in \mathbb{N} : k_1 + \ldots + k_m = n }$ for any

[R] Optimal Code for subset of Integer Sets

2011-07-26 Thread David Pham
Hi, I wanted to know if there existed an good implementation in R of the following classical subset Integers : $P_{n,m} = {k_1, \ldots, k_m \in \mathbb{N} : k_1 + \ldots + k_m = n }$ for any integers $m < n$. There is an obvious not optimal code which would be to run through $m$ sums and put a