Learn R Programming

descsuppR (version 1.2)

calc_descr_long: calc_descr_long

Description

change the description into the long format

Usage

calc_descr_long(
  x,
  xname,
  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

data.frame of character describing x

Arguments

x

vector of which to calc the descriptive values

xname

the name of the variable encoded in x

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

logical. include the number of NAs in the output?

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

Details

only for internal use.