% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/restructure.R
\name{restructure}
\alias{restructure}
\title{Restructure tables to make them easier to process programmatically}
\usage{
restructure(tab_output, lvls = c())
}
\arguments{
\item{tab_output}{output from a tabulation function. An object of class
\code{astra_table} or \code{astra_list}.}

\item{lvls}{(optional) only show these levels.}
}
\value{
\code{data.frame}
}
\description{
Restructure the output of the tabulation functions to make
it more structured and easier to process programmatically.
}
\details{
Also see \code{\link[=as.data.frame.astra_table]{as.data.frame.astra_table()}} and \code{set_opts(raw = TRUE)}.
}
\examples{
set_survey(namcs2019sv, mode = "nchs")

## total() |> restructure()
restructure( total() )

## tab_subset("MAJOR", "AGER") |> restructure(lvls = c("Pre-surgery", "Post-surgery"))
mytables = tab_subset("MAJOR", "AGER")
restructure(mytables, lvls = c("Pre-surgery", "Post-surgery"))
}
\seealso{
Other print: 
\code{\link{as.data.frame.astra_table}()},
\code{\link{print.astra_table}()},
\code{\link{set_opts}()}
}
\concept{print}
