If a tabulation function produces multiple tables, that group of tables is a list,
with each element of the list being an individual table. To convert one of these tables
to a data.frame
, use [[
. For example, in the following code, we generate
3 tables, and then convert the third table to a data.frame
.
set_survey(namcs2019sv)
mytables = tab("MDDO", "SPECCAT", "MSA")
mydf = as.data.frame(mytables[[3]])