On Mon, Jun 8, 2009 at 3:04 PM, baptiste auguie
wrote:
> Marie Sivertsen wrote:
>
>> Dear list,
>>
>> I have a vector of elements which I want to combined each with each, but
>> none with itself. For example,
>>
>>
>>
>>> v <- c("a", "b", "c")
>>>
>>>
>>
>> and I need a function 'combine' such tha
Thank you both Dimitiris and Jorge Ivan! I have just found it myself that
'combn' does what I need:
> combn(v, 2, simplify=TRUE)
is exactly what I need.
Mvh.,
Marie
On Mon, Jun 8, 2009 at 3:03 PM, Dimitris Rizopoulos <
d.rizopou...@erasmusmc.nl> wrote:
> one way is:
>
> combn(c("a", "b",
Marie Sivertsen wrote:
Dear list,
I have a vector of elements which I want to combined each with each, but
none with itself. For example,
v <- c("a", "b", "c")
and I need a function 'combine' such that
combine(v)
[[1]]
[1] "a" "b"
[[2]]
[1] "a" "b"
[[3]]
[1] "b" "c"
I a
one way is:
combn(c("a", "b", "c"), 2)
I hope it helps.
Best,
Dimitris
Marie Sivertsen wrote:
Dear list,
I have a vector of elements which I want to combined each with each, but
none with itself. For example,
v <- c("a", "b", "c")
and I need a function 'combine' such that
combine(v)
Dear Marie,
Try this:
combn(v,2,list)
HTH,
Jorge
On Mon, Jun 8, 2009 at 8:56 AM, Marie Sivertsen wrote:
> Dear list,
>
> I have a vector of elements which I want to combined each with each, but
> none with itself. For example,
>
> > v <- c("a", "b", "c")
>
> and I need a function 'combine' su
Dear list,
I have a vector of elements which I want to combined each with each, but
none with itself. For example,
> v <- c("a", "b", "c")
and I need a function 'combine' such that
> combine(v)
[[1]]
[1] "a" "b"
[[2]]
[1] "a" "b"
[[3]]
[1] "b" "c"
I am not very interested in the orders of th
6 matches
Mail list logo