Serguei Kaniovski wrote:
> Dear List,
>
> I am looking for a faster way of accomplishing this:
>
> # n is an integer larger than two
> n <- 3
>
> # matrix of 2^n binary outcomes
> bmat <- as.matrix(expand.grid( rep( list(1:0), n))[, n:1])
>
> # I would like to know which rows of "bmat" have "
Dear List,
I am looking for a faster way of accomplishing this:
# n is an integer larger than two
n <- 3
# matrix of 2^n binary outcomes
bmat <- as.matrix(expand.grid( rep( list(1:0), n))[, n:1])
# I would like to know which rows of "bmat" have "1" in the "i" and "j"
coordinates, so for n=3 in