freq: Frequency table for a single variable

View source: R/freq.R

freqR Documentation

Frequency table for a single variable

Description

This is a frequency table function which prints the frequency and related row percentage for a given categorical variable.The function creates the count and related row percentages for a given categorical variables and allows naming the header. Provide the distinct level names as a list.

Usage

freq(var, row, colnames)

Arguments

var

A categorical variable to be analyzed

row

Row name for the output

colnames

Level names for the categorical variable

Examples

#Example
set.seed(1234)
letter = list(sample(letters[1:5], 20, replace=TRUE))
freq( letter, row = c("Letter"), colnames = c("A", "B", "C", "D", "E"))

dtdibaba/StatTools documentation built on Jan. 27, 2025, 3:59 p.m.