% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/survey-collection.R
\name{remove_survey}
\alias{remove_survey}
\title{Remove Surveys from a \code{survey_collection}}
\usage{
remove_survey(x, name)
}
\arguments{
\item{x}{A \code{survey_collection}.}

\item{name}{Character vector of survey names to drop. All names must be
present in \code{names(x)}.}
}
\value{
A new \code{survey_collection} without the dropped surveys. Errors
\code{surveycore_error_collection_empty} if removing would leave the
collection empty.
}
\description{
Drops one or more named surveys from a collection and returns a new
\code{survey_collection}. Errors if any requested name is not present.
}
\examples{
d1 <- as_survey(gss_2024, ids = vpsu, weights = wtssps,
                strata = vstrat, nest = TRUE)
d2 <- as_survey(gss_2024, ids = vpsu, weights = wtssps,
                strata = vstrat, nest = TRUE)
coll <- as_survey_collection(a = d1, b = d2)
coll2 <- remove_survey(coll, "a")
names(coll2)

}
\seealso{
\code{\link[=as_survey_collection]{as_survey_collection()}}, \code{\link[=add_survey]{add_survey()}}

Other collections: 
\code{\link{add_survey}()},
\code{\link{as_survey_collection}()},
\code{\link{set_collection_id}()},
\code{\link{set_collection_if_missing_var}()},
\code{\link{survey_collection}()}
}
\concept{collections}
