Re: [R] Listing all of combinations

From: Muhammad Subianto <msubianto_at_gmail.com>
Date: Sat 15 Jul 2006 - 03:09:25 EST


On this day 14/07/2006 15:35, miao wrote:
> Dear All:
>
> I want to list all of combination among (a,b,c,d,e,f,g,h). I try to use lp<-ist(A=c(a,b,c,d,e,f,g,h),B=(a,b,c,d,e,f,g,h)....etc.).and then use expand.grid(p). this does not work for the same vector A,B...
>
> Anyone had this experince?
>
>
> Thanks!
>
> Xin
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

Try this below:

A <- letters[1:8]
B <- letters[1:8]
lp<-list(A,B)

expand.grid(lp)

Best, Muhammad Subianto



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 15 03:17:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 04:15:14 EST.

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