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]]
______________________________________________
[email protected] 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.