% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scale_weights.R
\name{scale_weights}
\alias{scale_weights}
\title{Scale weights}
\usage{
scale_weights(x)
}
\arguments{
\item{x}{\verb{[numeric >= 0]} A positive numeric vector with at least one
non-zero element.}
}
\value{
A numeric vector that sums to 1. If there are \code{NA}s in \code{x} then the result
sums 1 to if these values are removed.
}
\description{
Scale a vector of weights so that they sum to 1.
}
\examples{
scale_weights(1:5)

scale_weights(c(1:5, NA))
}
\seealso{
Other math functions:
\code{\link[=emean]{emean()}},
\code{\link[=gmean]{gmean()}},
\code{\link[=nested_gmean]{nested_gmean()}},
\code{\link[=transmute_weights]{transmute_weights()}},
\code{\link[=transmute_weights2]{transmute_weights2()}},
\code{\link[=update_weights]{update_weights()}}
}
\concept{math functions}
