ggpiestats

0th

Percentile

Pie charts with statistical tests

Pie charts for categorical data with statistical details included in the plot as a subtitle.

Arguments
data

The data as a data frame.

main

A string naming the variable to use as the rows in the contingency table.

condition

A string naming the variable to use as the columns in the contingency table.

factor.levels

A character vector with labels for factor levels of main variable.

stat.title

Title for the effect being investigated with the chi-square test.

title

The text for the plot title.

caption

The text for the plot caption.

k

Number of decimal places expected for results.

legend.title

Title of legend.

facet.wrap.name

The text for the facet_wrap variable label.

facet.proptest

Decides whether proprotion test for main variable is to be carried out for each level of condition (Default: TRUE).

messages

Decides whether messages references, notes, and warnings are to be displayed (Default: TRUE).

Aliases
  • ggpiestats
Examples
# NOT RUN {
library(ggplot2)

# simple function call with the defaults
ggstatsplot::ggpiestats(
data = datasets::iris,
main = Species
)

# more detailed function call
ggstatsplot::ggpiestats(
data = datasets::mtcars,
main = am,
condition = cyl,
factor.levels = c("zero", "one"),
stat.title = "interaction",
title = "Dataset: mtcars",
caption = "This is a demo",
legend.title = "transmission",
facet.wrap.name = "No. of cylinders",
facet.proptest = TRUE
)

# }
Documentation reproduced from package ggstatsplot, version 0.0.2, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.