[R] Create combinations of rows

Enrico Schumann enricoschumann at yahoo.de
Wed Oct 5 06:36:15 CEST 2011


?expand.grid

Am 05.10.2011 00:21, schrieb darkgaze:
> I don't quite know how to word what I want, but if I have
>
> (1, 2, 3); (a, b, c); (x, y)
>
> I want:
>
> 1 a x
> 1 b x
> 1 c x
> 1 a y
> 1 b y
> 1 c y
> 2 a
> ...
>
> and so forth
>
> What is the appropriate command?
>
> Best,
> Don
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Create-combinations-of-rows-tp3872641p3872641.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/



More information about the R-help mailing list