Creating a dataframe with an added column corresponding to summary for categorical variables.
cat_label_df(data, label.content = "percentage", perc.k = 1, ...)
A dataframe containing summaries for categorical variables.
Should contain columns named either "perc"
or "counts"
or both.
Character decides what information needs to be displayed
on the label in each pie or bar slice. Possible options are "percentage"
(default), "counts"
, "both"
.
Numeric that decides number of decimal places for percentage
labels (Default: 0
).
Ignored.
# 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