create_table_one {hgutils}R Documentation

Table one

Description

Table one

Usage

create_table_one(df, numbers_as_categories = TRUE, deaths = NULL)

create_contigency_table(df, x, max_size = 8, numbers_as_categories = TRUE, ...)

percentage_table(x, n_digits = 2)

Arguments

df

data.frame.

numbers_as_categories

Whether numbers should be categorized.

deaths

The number of deaths in the population.

x

column vector name in df.

max_size

maximum size of unique elements in the numeric variable x before the values are clustered.

...

Arguments passed on to get_breaks

limits

axis limits. May be either a vector of 2 elements with lower and upper bounds, or a single number (which is the upper bound, the lower bound is then assumed to be 0).

N

step size. The eventual intervals will be multiples of the divisors of N or multiples of N when multiples_only is TRUE. Defaults to 10.

max_breaks

maximum amount of breaks, defaults to 10.

int_only

whether only integer divisors of N may be used as breaks, defaults to TRUE.

multiples_only

whether only multiples of N can be used as breaks, defaults to FALSE.

include_bounds

whether the resulting breaks should encompass min and max. Defaults to TRUE.

n_digits

The number of digits to which the percentages are rounded.

Value

A dataframe containing the contingency tables for each of the variables in df.

A matrix with distinct (factor) labels and corresponding counts and percentages.


[Package hgutils version 0.2.11 Index]