Learn R Programming

helda (version 1.1.5)

proc_freq: 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

References

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

Examples

Run this code
# NOT RUN {
data <- iris
str(data)
result <- proc_freq(data$Species)
result
# }

Run the code above in your browser using DataLab