Skip to contents

This function plots a piechart with ggplot.

Usage

plot_piechart(
  df,
  logical_var = NULL,
  grouping_var,
  colors,
  display_legend = FALSE
)

Arguments

df

DATAFRAME : a long dataframe containing information to plot (no default)

logical_var

CHARACTER : a column of df containing logical value to only plot a subset of the dataframe. Only rows with TRUE will be kept (default to NULL, i.e., keep all rows)

grouping_var

CHARACTER : a column of df to make a piechart with (default to NULL)

colors

VECTOR : a vector of colors (default to NULL)

display_legend

LOGICAL : whether to print the legend or not (default to FALSE)

Value

This function returns a ggplot object