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