Learn R Programming

ggstatsplot (version 0.5.0)

cat_label_df: Summary dataframe for categorical variables.

Description

Creating a dataframe with an added column corresponding to summary for categorical variables.

Usage

cat_label_df(data, label.content = "percentage", perc.k = 1, ...)

Arguments

data

A dataframe containing summaries for categorical variables. Should contain columns named either "perc" or "counts" or both.

label.content

Character decides what information needs to be displayed on the label in each pie or bar slice. Possible options are "percentage" (default), "counts", "both".

perc.k

Numeric that decides number of decimal places for percentage labels (Default: 0).

...

Ignored.

Examples

Run this code
# NOT RUN {
# dataframe with label column
ggstatsplot:::cat_label_df(
  data = ggstatsplot:::cat_counter(mtcars, am, cyl),
  label.content = "both",
  perc.k = 1
)
# }

Run the code above in your browser using DataLab