Dear Marcelo,

This is, I guess, permn() in the combinat package.

How about unique(matrix(unlist(permn(c(1,1,0))), ncol=3, byrow=TRUE)), which
leaves the permutations in the rows of a matrix?

I hope this helps,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Sunday, February 13, 2005 9:45 AM
> To: [email protected]
> Subject: [R] combinations without repetition
> 
> The solution is probably simple but I need someone to point me to it.
> How can I reduce the following 6 permutations to the 3 unique 
> combinations
> (1,1,0) (1,0,1) (0,1,1)?
> 
> permn(c(1,1,0))
> [[1]]
> [1] 1 1 0
> 
> [[2]]
> [1] 1 0 1
> 
> [[3]]
> [1] 0 1 1
> 
> [[4]]
> [1] 0 1 1
> 
> [[5]]
> [1] 1 0 1
> 
> [[6]]
> [1] 1 1 0
> 
> Thanks a lot
> Marcelo Jenny
> 
> ______________________________________________
> [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

______________________________________________
[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

Reply via email to