freqTab: Frequency Table

View source: R/freqTab.R

freqTabR Documentation

Frequency Table

Description

Create a frequency table of unique values in a data column.

Usage

freqTab(df,var,maxvals,noties)

Arguments

df

This is the dataframe you want to use

var

This is the variable you want to look at the frequency of

maxvals

This is the maximum number of unique values you want to return (useful if there are dozens or hundreds of unique values in a column). If maxvals = n, and there is a tie for the number of observations in the nth largest unique value, then both values will be returned.

noties

This states whether the function should return exactly N rows or all of the values in the top N rankings (i.e., includes possibility of multiple rows that are tied for Nth place).

Value

A frequency table listing the number of instances each unique value is in a data column, along with each value's percentage of the total.

Author(s)

Andrew J. Van Leuven, vanleuven.3@osu.edu


andrewvanleuven/rleuven documentation built on July 19, 2022, 12:13 a.m.