% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/use_weights.R
\name{get_resampling_idxs}
\alias{get_resampling_idxs}
\title{Get Importance Resampling Indices From Weights}
\usage{
get_resampling_idxs(x, frac = 1, replace = TRUE)
}
\arguments{
\item{x}{A vector of weights, a list of weight vectors, or a data frame of
type \code{adjustr_weighted} containing a \code{.weights} list-column
of weights.}

\item{frac}{A real number giving the fraction of draws to resample; the
default, 1, resamples all draws. Smaller values should be used when
\code{replace=FALSE}.}

\item{replace}{Whether sampling should be with replacement. When weights
are extreme it may make sense to use \code{replace=FALSE}, but accuracy
is not guaranteed in these cases.}
}
\value{
A vector, list, or data frame, depending of the type of \code{x},
containing the sampled indices. If any weights are \code{NA}, the indices
will also be \code{NA}.
}
\description{
Takes a vector of weights, or data frame or list containing sets of weights,
and resamples indices for use in later computation.
}
\examples{
spec = make_spec(eta ~ student_t(df, 0, 1), df=4:10)
adjusted = adjust_weights(spec, eightschools_m, keep_bad=TRUE)

get_resampling_idxs(adjusted)
get_resampling_idxs(adjusted, frac=0.5, replace=FALSE)

}
