% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estpw_s5_multi_s1_reorder.R
\name{sort_by_sp_size}
\alias{sort_by_sp_size}
\title{Sort reference samples by size}
\usage{
sort_by_sp_size(sp, vars, weight, design, sp_order, verbose = FALSE)
}
\arguments{
\item{sp}{List of reference sample data frames.}

\item{vars}{List of character vectors of predictor variable names,
one per element of `sp`.}

\item{weight}{Character vector of survey-weight column names,
one per element of `sp`.}

\item{design}{List of `survey.design2` or `svyrep.design` objects,
one per element of `sp`.}

\item{sp_order}{Character scalar. `"size"` reorders reference samples
largest-first; `"given"` keeps the user-supplied order.}

\item{verbose}{Logical. If `TRUE`, a summary of the ordering is printed.}
}
\value{
A list with components:
  \item{sp}{Reordered list of reference sample data frames.}
  \item{vars}{Reordered list of predictor variable name vectors.}
  \item{weight}{Reordered character vector of weight column names.}
  \item{design}{Reordered list of survey design objects.}
  \item{order_used}{Integer vector giving the reordering index.}
  \item{log}{Character vector of log messages describing the ordering.}
}
\description{
Sort reference samples by size
}
\keyword{internal}
