crosstab: Function for creating a crosstabs

Description Usage Arguments

View source: R/crosstab.R

Description

This function creates crosstabs in a flexible manner.

Usage

1
2
3
4
crosstab(data, formula = NULL, row.vars = "", col.vars = "",
  format = "freq", useNA = "ifany", title = "",
  row.margin.format = "none", col.margin.format = "freq", dnames = "",
  pretty.print = FALSE)

Arguments

data

Data frame to be analyzed

formula

A formula for the table with a single row column on the left and column variables in the right

row.vars

A single or vector of row variables, quoted. These are appended to any row variable from formula.

col.vars

A single or vector of column variables, quoted. These are appended to any column variables from formula.

format

"freq", "col_percent", "row_percent", "total_percent"

title

string Title to be used for printing

row.margin.format

"percent" to show row percents, "freq" to show row frequency, "none" for no margin

col.margin.format

"percent" to show percents, "freq" to show column frequencies, "none" for no margin

dnames

vector Dimension names to replace the variable names.

useNa

"ifany", "no", "always"

pretty.pring

logical TRUE means to add linebreaks for printing with Pander or another package.


lehmansociology/lehmansociology documentation built on Jan. 9, 2018, 12:46 a.m.