format_freqs: Formatting function for absolute and relative frequencies

View source: R/prettyDigits.R

format_freqsR Documentation

Formatting function for absolute and relative frequencies

Description

Formatting function for absolute and relative frequencies

Usage

format_freqs(
  numerator,
  denominator = 1,
  absolute_relative_frequency_mode = c("both", "only_absolute", "only_relative"),
  percent_accuracy = NULL,
  percent_suffix = "%"
)

Arguments

numerator

(numeric) numerator for % calculations

denominator

(numeric) denominator for % calculations

absolute_relative_frequency_mode

one of c("both", "only_absolute", "only_relative"). "both" will print "Absolute Freq. (Relative Freq. %)", the other options work accordingly.

percent_accuracy

NULL or numeric. Refer to the accuracy argument in percent.

percent_suffix

usually "%" or "". Refer to the suffix argument in percent.

Value

string of formatted frequencies


DescrTab2 documentation built on Sept. 6, 2022, 9:05 a.m.