freqTable: Frequency table with number of cases and relative number of...

View source: R/DataUnderstanding.R

freqTableR Documentation

Frequency table with number of cases and relative number of cases

Description

Provides a table with absolute and relative number of cases. The output table can be easily used in Markdown with kable().

Usage

freqTable(x, printNA = TRUE)

Arguments

x

vector. Should be a vector.

printNA

boolean. Print NA values? Default is TRUE

Details

Per default NA values will be displayed, no matter if there are any. Set 'printNA' argument to FALSE to surpress NA values. Please note: If there are any NA values in x (variable), a warning will be issued!

Value

data.frame. absolute and relative values

Examples

## iris
freqTable(x = iris$Species, printNA = TRUE)
## mtcars
# automatic or manual?
freqTable(x = mtcars$am, printNA = FALSE)
# number of gears
freqTable(x = mtcars$gear, printNA = FALSE)
# NA values in variable
freqTable(x = airquality$Ozone, printNA = TRUE)
freqTable(x = airquality$Ozone, printNA = FALSE)

masem-research/masemDataUnderstanding documentation built on May 5, 2022, 12:40 a.m.