count_vars_plot_facet: Count Variables to Plot Bar Graph with Facet

View source: R/count.R

count_vars_plot_facetR Documentation

Count Variables to Plot Bar Graph with Facet

Description

A Helper that count variable in each group of var_facet do extract percentage and construct labels column ready to be plotted.

Usage

count_vars_plot_facet(
  x,
  var,
  var_facet,
  label_number = c("percent", "count", "both")
)

Arguments

x

A data.frame

var

(Quoted or Unquoted) Variable to count

var_facet

(Quoted or Unquoted) Variable intended to get facet wrapped (grouping variable)

label_number

Construction of labels column in the output

  • "percent": use ⁠%⁠ (eg. 60%)

  • "count": count as integer (eg. 6)

  • "both": use ⁠%⁠ and count in parenthesis (eg. 60% (6))

Value

A data.frame

Examples

count_vars_plot_facet(mtcars, cyl, gear)

Lightbridge-KS/lbx documentation built on Dec. 4, 2024, 2:53 a.m.