prGetStatistics: Get statistics according to the type

Description Usage Arguments Value

View source: R/private_functions.R

Description

A simple function applied by the getDescriptionStatsBy for the total column.

Usage

1
2
3
4
5
prGetStatistics(x, show_perc = FALSE, html = TRUE, digits = 1,
  numbers_first = TRUE, show_missing = TRUE, show_missing_digits = digits,
  show_all_values = FALSE, continuous_fn = describeMean,
  factor_fn = describeFactors, prop_fn = factor_fn,
  percentage_sign = percentage_sign)

Arguments

x

The variable that you want the statistics for

html

If HTML compatible output shoudl be used instead of default LaTeX

digits

The number of decimals used

numbers_first

If the number should be given or if the percentage should be presented first. The second is encapsulated in parentheses ().

show_missing

Show the missing values. This adds another row if there are any missing values.

show_missing_digits

The number of digits to use for the missing percentage, defaults to the overall digits.

show_all_values

This is by default false as for instance if there is no missing and there is only one variable then it is most sane to only show one option as the other one will just be a complement to the first. For instance sex - if you know gender then automatically you know the distribution of the other sex as it's 100 % - other %. To choose which one you want to show then set the default_ref parameter.

continuous_fn

The method to describe continuous variables. The default is describeMean.

factor_fn

The method used to describe factors, see describeFactors.

prop_fn

The method used to describe proportions, see describeProp.

percentage_sign

If you want to surpress the percentage sign you can set this variable to FALSE. You can also choose something else that the default % if you so wish by setting this variable.

Value

A matrix or a vector depending on the settings


raredd/Gmisc0 documentation built on May 27, 2019, 2:02 a.m.