Flat (proportional) tables

Description

This function creates a labelled flat table or flat proportional (marginal) table.

Usage

1
2
flat_table(.data, ..., margin = c("counts", "cell", "row", "col"),
  digits = 2)

Arguments

.data

A data frame.

...

One or more variables of .data that should be printed as table.

margin

Specify the table margin that should be computed for proportional tables. By default, counts are printed. Use margin = "cell", margin = "col" or margin = "row" to print cell, column or row percentages of the table margins.

digits

Numeric; for proportional tables, digits indicates the number of decimal places.

Value

An object of class ftable.

See Also

frq for simple frequency table of labelled vectors.

Examples

1
2
3
4
5
6
7
data(efc)

# flat table with counts
flat_table(efc, e42dep, c172code, e16sex)

# flat table with proportions
flat_table(efc, e42dep, c172code, e16sex, margin = "row")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.