% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as.data.frame.R
\name{as.data.frame.astra_table}
\alias{as.data.frame.astra_table}
\title{Coerce an astra table to a data frame}
\usage{
\method{as.data.frame}{astra_table}(x, ...)
}
\arguments{
\item{x}{a table produced by a tabulation function}

\item{...}{ignored}
}
\value{
A data frame.
}
\description{
Coerce an astra table to a data frame. To restructure tables to make them
easier to process programmatically, see \code{restructure()}. Also see \code{set_opts(raw = TRUE)}.

If a tabulation function produces multiple tables, that group of tables is a \code{list},
with each element of the list being an individual table. To convert one of these tables
to a \code{data.frame}, use \code{[[}. For example, in the following code, we generate
3 tables, and then convert the third table to a \code{data.frame}.

\if{html}{\out{<div class="sourceCode">}}\preformatted{set_survey(namcs2019sv)
mytables = tab("MDDO", "SPECCAT", "MSA")
mydf = as.data.frame(mytables[[3]])
}\if{html}{\out{</div>}}
}
\examples{
set_survey(namcs2019sv)
as.data.frame( tab("AGER") )
}
\seealso{
Other print: 
\code{\link{print.astra_table}()},
\code{\link{restructure}()},
\code{\link{set_opts}()}
}
\concept{print}
