powered by
exchange returns a new design matrix after two randomly selected elements are switched from a user-defined column.
exchange
exchange(X, j)
A Matrix.
A positive integer.
If all inputs are logical, then the output will be a new design matrix after the exchange.
X stands for the design matrix.
X
j is the j^th column of the design matrix, and it should be in [1,ncol(X)].
j
# NOT RUN { #create a toy LHD with 5 rows and 3 columns toy=rLHD(n=5,k=3);toy #Choose the first column of toy and exchange two randomly selected elements. toy_new=exchange(X=toy,j=1) toy;toy_new # }
Run the code above in your browser using DataLab