alf Of
> Stavros Macrakis
> Sent: Tuesday, March 17, 2009 10:46 PM
> To: Greg Snow
> Cc: onyourmark; r-help@r-project.org
> Subject: Re: [R] permutations in R
>
> On Tue, Mar 17, 2009 at 12:41 PM, Greg Snow
> wrote:
> > No, I meant the Combinations package, it is ap
Stavros Macrakis wrote:
> On Tue, Mar 17, 2009 at 5:24 AM, Gavin Simpson
> wrote:
>
>> On Mon, 2009-03-16 at 18:43 -0400, Stavros Macrakis wrote:
>>
>>> ... no way to find relevant functions, and no way of knowing which one to
>>> use if there is more than one.
>>>
>
>
>> That
On Tue, Mar 17, 2009 at 12:41 PM, Greg Snow wrote:
> No, I meant the Combinations package, it is apparently an Omegahat package
> (http://www.omegahat.org/Combinations/). It looks similar to the permn
> function as far as the usage goes, but the documentation includes additional
> information
On Tue, Mar 17, 2009 at 5:24 AM, Gavin Simpson wrote:
> On Mon, 2009-03-16 at 18:43 -0400, Stavros Macrakis wrote:
>> ... no way to find relevant functions, and no way of knowing which one to
>> use if there is more than one.
> That is what the Task Views are meant to address, for discrete subje
ject.org
> Subject: Re: [R] permutations in R
>
> Greg,
>
> Thanks for helping this user.
>
> I assume you mean the permn function in the combinat package? For a
> new user (including me), it is not obvious how to get from "the
> permutations function in the Combina
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> >> project.org] On Behalf Of onyourmark
> >> Sent: Friday, March 13, 2009 7:09 PM
> >> To: r-help@r-project.org
> >> Subject: [R] permutations in R
> >>
> >>
> >>
ct.org] On Behalf Of onyourmark
Sent: Friday, March 13, 2009 7:09 PM
To: r-help@r-project.org
Subject: [R] permutations in R
Hi. Does anyone know of a function which will take as input a
number n
(or a
set of n letters) and will give out, one at a time, the
permutations of
n
(or of those n l
n Healthcare
> greg.s...@imail.org
> 801.408.8111
>
>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
>> project.org] On Behalf Of onyourmark
>> Sent: Friday, March 13, 2009 7:09 PM
>> To: r-help@r-project.org
>>
ermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of onyourmark
> Sent: Friday, March 13, 2009 7:09 PM
> To: r-help@r-project.org
> Subject: [R] permutations
Try this:
> # Taken from combinations(gtools)
> # library(gregmisc)
> # Function permutations
> fn_perm_list <-
+ function (n, r, v = 1:n)
+ {
+if (r == 1)
+ matrix(v, n, 1)
+else if (n == 1)
+ matrix(v, 1, r)
+else {
+ X <- NULL
+ for (i in 1:n) X <- rbind(X, c
Hi. Does anyone know of a function which will take as input a number n (or a
set of n letters) and will give out, one at a time, the permutations of n
(or of those n letters) as a vector?
So that I can use the permutations one at a time. And such that it will
exhaust all the permutations with no r
11 matches
Mail list logo