[R] Create combinations of rows

Peter Alspach Peter.Alspach at plantandfood.co.nz
Wed Oct 5 07:10:24 CEST 2011


Tena koe Don

?expand.grid

HTH ....

Peter Alspach

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of darkgaze
> Sent: Wednesday, 5 October 2011 11:21 a.m.
> To: r-help at r-project.org
> Subject: [R] Create combinations of rows
> 
> 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.

The contents of this e-mail are confidential and may be subject to legal privilege.
 If you are not the intended recipient you must not use, disseminate, distribute or
 reproduce all or any part of this e-mail or attachments.  If you have received this
 e-mail in error, please notify the sender and delete all material pertaining to this
 e-mail.  Any opinion or views expressed in this e-mail are those of the individual
 sender and may not represent those of The New Zealand Institute for Plant and
 Food Research Limited.



More information about the R-help mailing list