% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/var_collapse.R
\name{var_collapse}
\alias{var_collapse}
\title{Collapse factor levels}
\usage{
var_collapse(vr, newlevel, oldlevels)
}
\arguments{
\item{vr}{factor variable}

\item{newlevel}{name of the new level}

\item{oldlevels}{vector of old levels}
}
\value{
Survey object
}
\description{
Collapse two or more levels of a factor variable into a single level.
}
\examples{
set_survey(namcs2019sv)
tab("PRIMCARE")
var_collapse("PRIMCARE", "Unknown if PCP", c("Blank", "Unknown"))
tab("PRIMCARE")
}
\seealso{
Other variables: 
\code{\link{var_all}()},
\code{\link{var_any}()},
\code{\link{var_case}()},
\code{\link{var_copy}()},
\code{\link{var_cross}()},
\code{\link{var_cut}()},
\code{\link{var_not}()}
}
\concept{variables}
