tab: Makes a fancy table, inspired from 'tab' from STATA.

Description Usage Arguments

View source: R/tab.R

Description

Makes a fancy table, inspired from 'tab' from STATA.

Usage

1
2
tab(.data, ..., top = 0, freq = TRUE, percent = FALSE, byrow = TRUE,
  sort = TRUE, sort.decreasing = TRUE, na.rm = FALSE)

Arguments

.data

data frame. The data to put in the table.

...

The variables to plot in the table, plus any relevant filters contained within 'filters()'. Currently supports one or two variables.

top

numeric. If >0, all vectors will only print the top N elements and all other elements will be called "Other", where N is the value for top.

freq

logical. If TRUE, frequencies are printed in the table.

percent

logical. If TRUE, percentages are printed in the table.

byrow

logical. If TRUE, percentages are row percentages. If false, column percentages. If NULL, individual cell percentages.

sort

logical. If TRUE, the resulting table is sorted (if possible).

sort.decreasing

logical. If TRUE, the sort is preformed in a descending manner.

na.rm

logical. If TRUE, all NAs and NA-like entries are removed from the data before tabling.


peterhurford/surveytools2 documentation built on Feb. 18, 2021, 9:13 p.m.