Learn R Programming

sdef (version 1.7)

designMatrix: Internal function

Description

This is an internal function. The user should not use the function directly.

Usage

designMatrix(lists)

Arguments

lists

The number of lists to be compared

Examples

Run this code
# NOT RUN {
## The function is currently defined as
function(lists){
rows = 2^(lists)
ncycles = rows
x = matrix(0,rows,lists)
for (k in 1:lists){   
settings = c(0,1)   
ncycles = ncycles/2   
nreps = rows/(2*ncycles)   
settings = matrix(rep(settings,nreps),nreps,
length(settings),byrow=TRUE)
settings = as.vector(settings)
#impila in un vettore settings, una colonna sotto l'altra
settings = matrix(rep(settings,ncycles),
length(settings),ncycles)
x[,lists-k+1] = as.vector(settings)
  }
return(x)
  }
# }

Run the code above in your browser using DataLab