proc_freq: SAS proc freq in R

View source: R/proc_freq.R

proc_freqR Documentation

SAS proc freq in R

Description

This function permits to reproduce the output of the SAS proc freq

Usage

proc_freq(variable, digits = 4)

Arguments

variable

vector on which we want to apply the function.

digits

integer that specifies the number of decimals we want to keep in the rounded figures.

Value

a R data frame of dimension [number of categories x 5]. The five columns display the following information:

  • Category: different categories of the original categorical variable

  • Frequency

  • Percentage

  • Cumulative.Frequency

  • Cumulative.Percentage

Author(s)

Simon CORDE

References

Link to the author's github package repository: https://github.com/Redcart/helda

Examples

data <- iris
str(data)
result <- proc_freq(data$Species)
result

Redcart/helda documentation built on March 3, 2023, 11:55 p.m.