Learn R Programming

descsuppR (version 1.2)

buildDescrTbl.intern: buildDescrTbl.intern

Description

Internal wrapper around calc_descr_matrix

Usage

buildDescrTbl.intern(
  df,
  prmnames,
  prmunits,
  addFactorLevelsToNames = TRUE,
  extraLevels = NULL,
  includeNAs = FALSE,
  includeNonNAs = FALSE,
  orderedAsUnordered = FALSE,
  factorlevellimit = 14,
  show.minmax = TRUE,
  show.IQR = FALSE,
  sd_digits = "by_mean",
  descr_digits = 2,
  significant_digits = TRUE
)

Value

matrix with descriptive values

Arguments

df

data.frame containing the variables of which to calc the descriptive values

prmnames

names of the variables in df (if needed to be overwritten)

prmunits

units of the variables in df

addFactorLevelsToNames

logical. if TRUE expand 'sex' to 'sex [m/w]'. Defaults to TRUE.

extraLevels

named list of lists. Names have to be variable names. Elements have to have to be named list of this form: `some label` = list(idxvec = idxvec, display = logical). Here idxvec needs to be a logical vector of length nrow(df) that specifies the affected rows. If display is TRUE the number of affected rows will be shown under some label.

includeNAs

boolean. Include number of NAs in the output? Currently only one of either includeNonNAs or includeNAs can be set to TRUE

includeNonNAs

boolean. Include number of not missing values (Non-NAs) in the output? Currently only one of either includeNonNAs or includeNAs can be set to TRUE

orderedAsUnordered

logical. treat ordered factors as unordered factors?

factorlevellimit

integer. for factors with more than factorlevellimit levels, not all levels are printed

show.minmax

logical. if TRUE show minimum and maximum for numeric variables. Defaults to TRUE.

show.IQR

logical. if TRUE show 25% and 75% quantiles for numeric variables. Defaults to FALSE.

sd_digits

character. one of c("by_mean", "fixed"). If 'by_mean', the number of decimal places of the standard deviation is limited by the number of decimal places of the mean.

descr_digits

integer. Number of digits for formatting of descriptive values. Defaults to 2.

significant_digits

boolean. if TRUE, the number of significant digits of is given by descr_digits. Otherwise the number of decimal places is fixed.

Author

Andreas Leha