prep_data_lollipop: Helper function for 'mk_lollipop'. Not for external use.

View source: R/prep_data_lollipop.R

prep_data_lollipopR Documentation

Helper function for mk_lollipop. Not for external use.

Description

prep_data_lollipop takes in the original data frame, the x, y variables, and instruction on how to order the y levels. It returns a data frame for making and labeling a horizontal lollipop chart.

Usage

prep_data_lollipop(df, xvar, yvar, yorder)

Arguments

df

Data frame of the original data.

xvar

String, name of x numeric variable.

yvar

String, name of y categorical (character or factor) variable.

yorder

String, possible values are "alphanumeric", "descend" or "ascend". If "alphanumeric", order y levels in alphanumerical order along y-axis. If "ascend"/"descend", order y levels in ascending/descending order of the sum of absolute x-values along y-axis.

Value

A data frame for making and labeling a horizontal lollipop chart.

See Also

mk_lollipop.


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