[R] combinations between two vectors

Sarah Goslee sarah.goslee at gmail.com
Thu Dec 18 16:06:09 CET 2014


I can't quite tell what you want: your example output is either
unclear to me or mangled by posting in HTML (please don't).

Is
expand.grid(test, test)
what you want, or partway to what you want?


Sarah

On Thu, Dec 18, 2014 at 9:56 AM, Alaios via R-help <r-help at r-project.org> wrote:
> Hi all,I am looking for a function that would give me all the combinations between two vectors.Lets take as example the
>
> test<-seq(1,30000,by=5000)
> Browse[2]> test
> [1]     1  5001 10001 15001 20001 25001
> I want all the combinations between two times the test... I think this is  called permutation so a function that could do permutation(test,test)and produce the following
> 1,11,50011,100011,15001....
> 3,13,5001...25001,20001,25001,25001
> is there such a function ?
> RegardsAlex
>
>
>         [[alternative HTML version deleted]]
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list