% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/add_totals.R
\name{add_total_level_to_var}
\alias{add_total_level_to_var}
\title{Add total level to variable}
\usage{
add_total_level_to_var(
  df,
  variable,
  level_name = "Total",
  sum_var = "value",
  na_rm = TRUE
)
}
\arguments{
\item{df}{Data frame to add total levels to.}

\item{variable}{Name of variable to add total level to.}

\item{level_name}{Total level name.}

\item{sum_var}{String, name of variable to sum over.}

\item{na_rm}{Optional. Logical. If TRUE, NAs are removed before summing.}
}
\value{
A data frame
}
\description{
Add a new level to a variables which is the sum of all other levels.
}
\keyword{internal}
