qtable: qtable

Description Usage Arguments Details Value Author(s) Examples

View source: R/qtable.R

Description

Same as qtable_, except designed for use with dplyr. It takes unquoted variable names and supports all dplyr select statements, except renaming in the select statement itself. qtable also looks for dplyr groups if they are not specified.

Usage

1
2
qtable(df, ..., groups = NULL, weight = NULL, margin = TRUE,
  margin_name = NULL, wide = TRUE)

Arguments

df

A data.frame or data.table.

...

Unquoted variable names passed to select.

groups

Variables to group by during aggregation.

weight

Name of a variable to weight by. Only used when margin = TRUE.

margin

If TRUE (the default), the first group will include a "Total".

margin_name

Optional: Give the margin a different name from "Total".

wide

Should a long or a wide table be returned? Wide tables spread levels for factor and unique values for character. For a single numeric, the last group is used, while multiple numeric will be spread by variable names.

Details

Note that groups and weight still have to be character vectors.

Value

Same as qtable.

Author(s)

Kristian D. Olsen

Examples

1
# TODO

itsdalmo/tabulR documentation built on May 18, 2019, 7:11 a.m.