Learn R Programming

fastrep (version 0.7)

freq_tbl: freq_tbl

Description

This function creates a frequency table, you only need to supply a data.frame and the variable to make the table.

Usage

freq_tbl(
  obj,
  var,
  sort_by = {
     {
         var
     }
 },
  desc = FALSE
)

Value

A tibble with 4 rows and 3 columns

Arguments

obj

Object used to create the table. Data frame, list or environment (or object coercible by as.data.frame to a data frame)

var

Variable that you want the table (not written in string format)

sort_by

Variable you want to sort the tibble

desc

if you want decreasing order put FALSE

Examples

Run this code
iris %>%
  fastrep::freq_tbl(Species) %>%
  fastrep::tbl("You can combine this function too!")

Run the code above in your browser using DataLab