rapportools (version 1.0)

rp.freq: Frequency Table

Description

Display frequency table with counts, percentage, and cumulatives.

Usage

rp.freq(f.vars, data, na.rm = TRUE, include.na = FALSE,
  drop.unused.levels = FALSE, count = TRUE, pct = TRUE,
  cumul.count = TRUE, cumul.pct = TRUE, total.name = "Total",
  reorder = FALSE)

Arguments

f.vars

a character vector with variable names

data

a data.frame

na.rm

should missing values be removed?

include.na

should missing values be included in frequency table?

drop.unused.levels

should empty level combinations be left out

count

show frequencies?

pct

show percentage?

cumul.count

show cumulative frequencies?

cumul.pct

show cumulative percentage?

total.name

a sting containing footer label (defaults to "Total")

reorder

reorder the table based on frequencies?

Value

a data.frame with a frequency table

Examples

Run this code
# NOT RUN {
rp.freq(c("am", "cyl", "vs"), mtcars)
# }

Run the code above in your browser using DataCamp Workspace