% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grid_depth.R
\name{safe_sample}
\alias{safe_sample}
\title{Safe sampling function}
\usage{
safe_sample(x, size, replace = FALSE)
}
\arguments{
\item{x}{Vector to sample from}

\item{size}{Number of samples}

\item{replace}{Sample with replacement?}
}
\description{
R's sample() has quirky behavior: sample(5, 1) samples from 1:5, not from c(5).
This function ensures we sample from the actual vector provided.
}
\keyword{internal}
