On Wed, 21 Dec 2011, Keith Jewell wrote:
Thanks Uwe,
I was happy that my 2 lines gave what the OP asked for, albeit in a
different order.
My puzzlement arose from Jeff Newmillers comment:
You could read the help for expand.grid very carefully for the answer to
this question.
... which I
Hi there,
I have a vector and would like to create a data frame, which contains
all unique combination of two elements, regardless of order.
myVec - c(1,2,3)
what expand.grid does:
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
what I would like to have
1,1
1,2
1,3
2,2
2,3
3,3
Can anybody help?
On Dec 21, 2011, at 08:59 , Antje Niederlein wrote:
Hi there,
I have a vector and would like to create a data frame, which contains
all unique combination of two elements, regardless of order.
myVec - c(1,2,3)
what expand.grid does:
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
You could read the help for expand.grid very carefully for the answer to this
question.
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.
OK, someone point it out to me; my wife tells me I can't see what's in front
of me :-}
I read ?expand.grid carefully, went to ?combn and ?choose but still couldn't
see an easy way to get what the OP asked for. The neatest I can get (which
isn't very neat!) is:
myVec - c(1,2,3)
eg -
On 21.12.2011 14:39, Keith Jewell wrote:
OK, someone point it out to me; my wife tells me I can't see what's in front
of me :-}
I read ?expand.grid carefully, went to ?combn and ?choose but still couldn't
see an easy way to get what the OP asked for. The neatest I can get (which
isn't very
Thanks Uwe,
I was happy that my 2 lines gave what the OP asked for, albeit in a
different order.
My puzzlement arose from Jeff Newmillers comment:
You could read the help for expand.grid very carefully for the answer to
this question.
... which I reas as saying that ?expand.grid would lead to
7 matches
Mail list logo