get_bar_labels_freq: Helper function for 'mk_barplot_freq'. Not for external use.

View source: R/get_bar_labels_freq.R

get_bar_labels_freqR Documentation

Helper function for mk_barplot_freq. Not for external use.

Description

get_bar_labels_freq takes in the original data frame, and returns a data frame of labels and their postions for mk_barplot_freq.

Usage

get_bar_labels_freq(df, var, fillby, show_pct)

Arguments

df

Data frame of the original data where bar charts are made of.

var

String, name of the categorical variable to be counted.

fillby

String, name of a second categorical variable used for sub-dividing and coloring the bars.

show_pct

Logical, if TRUE, calculate bars middle position using pct. Otherwise, calculate bars middle position using count. Default is FALSE.

Value

A data frame containing bar labels and their positions

See Also

mk_barplot_freq.


gmlang/ezplot documentation built on Sept. 18, 2022, 6:33 a.m.