% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shuffle.R
\name{shuffle}
\alias{shuffle}
\title{Safe Version of Sample}
\usage{
shuffle(x, n = length(x), ...)
}
\arguments{
\item{x}{(\code{vector()})\cr
Vector to sample elements from.}

\item{n}{(\code{integer()})\cr
Number of elements to sample.}

\item{...}{(\code{any})\cr
Arguments passed down to \code{\link[base:sample.int]{base::sample.int()}}.}
}
\description{
A version of \code{sample()} which does not treat positive scalar integer \code{x} differently.
See example.
}
\examples{
x = 2:3
sample(x)
shuffle(x)

x = 3
sample(x)
shuffle(x)
}
