print.astra_table: Print astra tables

View source: R/print.astra_table.R

print.astra_tableR Documentation

Print astra tables

Description

If a tabulation function is called from the top level, it should print out its table(s) on its own. If that tabulation function is called not from the top level, such as from within a loop or another function, you need to call print() explicitly. For example:

set_survey(namcs2019sv)
for (vr in c("AGER", "SEX")) {
  print( tab_subset(vr, "MAJOR", "Preventive care") )
}

Usage

## S3 method for class 'astra_table'
print(x, ...)

## S3 method for class 'astra_list'
print(x, ...)

Arguments

x

an object of class astra_table or astra_list.

...

passed to helper functions.

Details

The package used to produce the tables can be changed – see the output argument of set_opts() for details. By default, the table-making package huxtable is used.

Value

Returns x invisibly.

See Also

Other print: as.data.frame.astra_table(), restructure(), set_opts()

Examples

set_survey(namcs2019sv)
table1 = tab("AGER")
print(table1)
table_many = tab("MDDO", "SPECCAT", "MSA")
print(table_many)

surveytable documentation built on Aug. 20, 2026, 1:08 a.m.