cat_label_df

0th

Percentile

Summary dataframe for categorical variables.

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

Keywords
internal
Usage
cat_label_df(data, label.col.name = "slice.label",
  label.content = "percentage", label.separator = c("\n", " "),
  perc.k = 1)
Arguments
data

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

label.col.name

Character that decides the column name containing summary label. This can either be "slice.label" (default) or "data.label".

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".

label.separator

If "both" counts and proportion information is to be displayed in a label, this argument decides whether these two pieces of information are going to be on the same line (" ") or on separate lines ("\n").

perc.k

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

Aliases
  • cat_label_df
Examples
# NOT RUN {
# dataframe with label column
ggstatsplot:::cat_label_df(
  data = ggstatsplot:::cat_counter(mtcars, am, cyl),
  label.col.name = "slice.label",
  label.content = "both",
  perc.k = 1
)
# }
Documentation reproduced from package ggstatsplot, version 0.0.11, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.