freq_by: Frequencies and percentages

Description Usage Arguments Details Examples

View source: R/freq_by.R

Description

freq_by creates frequency and percentage tables in HTML.

Usage

1
2
freq_by(dataset, var_vector, by_group = NULL, include_total = TRUE,
  htmlout = TRUE)

Arguments

dataset

A dataset

var_vector

A character vector containing names of the columns in the input dataset to calculate frequencies and percentages for.

by_group

A string referring to a factor column in the input dataset by which to stratify the calculations.

include_total

whether to include frequencies and percentages not stratified by the by_group.

htmlout

Whether to output to html (default and intended usage), or as r-dataframe.

Details

The output is a table in HTML which can be viewed in a browser or included in a knitr-report.

Examples

1
2
# Outputs HTML:
output <- freq_by(example_data, c("cut", "color"), "clarity")

epitable documentation built on Sept. 28, 2017, 1:02 a.m.