# exchange

From LHD v0.1.0
by Hongzhi Wang

##### Exchange two random elements

`exchange`

returns a new design matrix after two randomly selected elements are switched from a user-defined column.

##### Usage

`exchange(X, j)`

##### Arguments

- X
A Matrix.

- j
A positive integer.

##### Details

`X`

stands for the design matrix.`j`

is the j^th column of the design matrix, and it should be in [1,ncol(X)].

##### Value

If all inputs are logical, then the output will be a new design matrix after the exchange.

##### Examples

```
# 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
# }
```

*Documentation reproduced from package LHD, version 0.1.0, License: MIT + file LICENSE*

### Community examples

Looks like there are no examples yet.