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 object. In general, X stands for the design matrix.
X
A positive integer, which stands for the j^th column of X, and it should be in [1,ncol(X)].
If all inputs are logical, then the output will be a new design matrix after the exchange.
# 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