aest_parts_and_whole: Plot parts and sum of parts

View source: R/aest_parts_and_whole.R

aest_parts_and_wholeR Documentation

Plot parts and sum of parts

Description

From a dataframe containing two discrete and one numeric variable, plots bars for each combination of the discrete variables and a line for the aggregate for each value of x_var

Usage

aest_parts_and_whole(
  df,
  x_var,
  y_var,
  group_var,
  position = "dodge",
  legend_spot = "right",
  caption_size = 5,
  line_colour = "black",
  title = NULL,
  subtitle = NULL,
  caption = NULL
)

Arguments

df

dataframe that contains (at a minimum) two discrete and one numeric variables.

x_var

a discrete variable to plot on the x-axis

y_var

a numeric variable to be plotted on y-axis

group_var

another discrete variable that the data is grouped by

position

Either "stack" or "dodge", Default: 'dodge'

legend_spot

where to put the legend, Default: 'right'

caption_size

font size for caption, Default=5

line_colour

the colour of the line

title

A title, Default: NULL

subtitle

A subtitle, Default: NULL

caption

A caption, Default: NULL

Details

DETAILS

Value

OUTPUT_DESCRIPTION

Examples

## Not run: 
if(interactive()){
 #EXAMPLE1
 }

## End(Not run)

rpmartin/aest documentation built on Oct. 22, 2022, 6:33 p.m.