# shuffle

From mlr3misc v0.1.0
by Michel Lang

##### Safe Version of Sample

A version of `sample()`

which does not treat positive scalar integer `x`

differently.
See example.

##### Usage

`shuffle(x, n = length(x), ...)`

##### Arguments

- x
::

`vector()`

Vector to sample elements from.- n
::

`integer()`

Number of elements to sample.- ...
::

`any`

Arguments passed down to`base::sample.int()`

.

##### Examples

```
# NOT RUN {
x = 2:3
sample(x)
shuffle(x)
x = 3
sample(x)
shuffle(x)
# }
```

*Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3*

### Community examples

Looks like there are no examples yet.