% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods-conversion.R
\name{as_svydesign}
\alias{as_svydesign}
\title{Convert a surveycore Design Object to a survey Package Design}
\usage{
as_svydesign(x)
}
\arguments{
\item{x}{A \code{survey_taylor}, \code{survey_replicate}, or \code{survey_twophase} object.}
}
\value{
A \code{survey::svydesign}, \code{survey::svrepdesign}, or \code{survey::twophase}
object.
}
\description{
Converts a \code{survey_taylor}, \code{survey_replicate}, or \code{survey_twophase} object
to the corresponding \code{survey} package object: \code{svydesign}, \code{svrepdesign},
or \code{twophase}. Useful for accessing \code{survey} package estimation functions
or for round-trip testing.
}
\details{
Metadata (variable labels, value labels) is NOT carried over — the \code{survey}
package has no metadata system.
}
\examples{
d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
               strata = sdmvstra, nest = TRUE)
if (requireNamespace("survey", quietly = TRUE)) {
  sv <- as_svydesign(d)
  survey::svymean(~ridageyr, sv, na.rm = TRUE)
}

}
\seealso{
\code{\link[=from_svydesign]{from_svydesign()}} to convert back from a \code{survey} design

Other conversion: 
\code{\link{as_tbl_svy}()},
\code{\link{from_svydesign}()},
\code{\link{from_tbl_svy}()}
}
\concept{conversion}
