Re: [R] How to get all combinations between two character vectors?

From: David L Lorenz <lorenz_at_usgs.gov>
Date: Fri, 11 Mar 2011 08:31:18 -0600

Rainer,
  The are probably lots of ways, I'd use

levels(interaction(c("a", "b"), c('x', 'y'), sep=''))

  Dave

>Hi
>
>I know there is a function - I have used it before - but I always forget
>what it is called...
>
>I need the combination of two character vectors, i.e:
>
>x <- c("a", "b")
>y <- c("x", "y")
>
>z <- THEFUNCTION(x, y)
>
>z == c("ax", "ay", "bx", "by")
>
>I promise I will write the name of the function on my desk!
>
>Thanks,
>
>Rainer

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 11 Mar 2011 - 14:36:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Mar 2011 - 14:40:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive