[R] mapping one redundant index to another redundant index

From: John Lande <john.lande77_at_gmail.com>
Date: Sat, 28 Jun 2008 13:38:54 +0200

Dear R users,

I have a simple problem I cannot solve, but I sure you can help.

I have two vector, let say

> tmp1 <- c("a", "a", "b", "c")
> tmp2 <- c("a", "a", "b", "c", "c", "d")

and I want to create a matrix of two column for which I have all the combinations of the same character, let say like this

> tmp3

     tmp1 tmp2
[1,] "a" "a"
[2,] "a" "a"
[3,] "a" "a"
[4,] "a" "a"
[5,] "b" "b"
[6,] "c" "c"
[7,] "c" "c"

how can I perform this task?

thank you!

        [[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 Sat 28 Jun 2008 - 14:57:11 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 Sat 28 Jun 2008 - 15:31:01 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