I need help generating all possible combination of a vector of randomly 
assigned values of 1 and -1.  For example, a vector of 20 randomly placed 1s 
and -1s, and all possibilities (which would amount to 2^20 total vectors).  I 
am able to generate one such vector (via sample(c(-1,1),20,replace=TRUE)), but 
I do not know how to generate all the possibilities, which would need to be 
placed in a matrix.  Any help would be greatly appreciated!!! 
______________________________________________
R-help@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.

Reply via email to