Learn R Programming

esvis (version 0.2.0)

pp_calcs: Produce calculations necessary for pp_plot.

Description

Produce calculations necessary for pp_plot.

Usage

pp_calcs(formula, data, ref_group = NULL, scheme = "ggplot2")

Arguments

formula

A formula of the type out ~ group where out is the outcome variable and group is the grouping variable. Note the grouping variable must only include only two groups.

data

The data frame that the data in the formula come from.

ref_group

Optional character vector (of length 1) naming the reference group to be plotted on the x-axis. Defaults to the highest scoring group.

scheme

What color scheme should the lines follow? Defaults to mimic the ggplot2 color scheme. Other options come from the viridisLite package, and must be installed first. These are the same options available in the package: "viridis", "magma", "inferno", and "plasma". These color schemes work well for color blindness and print well in black and white. Alternatively, colors can be supplied manually through a call to col (through ...).

Value

List with appropriate probs, name of the reference group, data for the reference group and all other groups, and data for the x/y axes.