violin: Draw Violins

View source: R/violin_functions.R

violinR Documentation

Draw Violins

Description

Draw violins on plots. Determines the values of the variable to evaluate (x_values) and the resulting evaluation values (y_values) of the distribution. these are the raw values

Usage

violin(
  x,
  location = NULL,
  rotate = TRUE,
  type = NULL,
  wex = 1,
  values = NULL,
  nvalues = NULL,
  side = "both",
  probs = c(0.025, 0.25, 0.5, 0.75, 0.975),
  ...
)

draw_probs(x, dist_values, violin_values, probs)

draw_violin(values, type = NULL, ...)

violin_values(
  dist_values,
  location = NULL,
  rotate = TRUE,
  type = "l",
  wex = 1,
  side = "both"
)

violin_length_values(dist_values, type = "l", side = "both")

violin_width_values(dist_values, type = "l", wex = 1, side = "both")

dist_values(x, values = NULL, nvalues = NULL, type = "l")

dist_x_values(x, nvalues)

dist_y_values(x, xvals)

default_nvalues(x, type = "l", nrf = NULL, minn = NULL, maxn = NULL)

default_violin_type(x = NULL)

violin_location(location = NULL, rotate = TRUE)

Arguments

x

The vector of values to be summarized

location

The graphical location with respect to the axes where the violin is to be placed. Default assumption is for the x-axis, but can be a named-by-axis vector.

rotate

Logical about if to rotate axes, default is TRUE.

type

Character indicating the type of plotting. Defaults to NULL which defines itself then based on the support for x to either "l" (line) for continuous and "r" (histogram-like rectangles) for non-continuous/integer-conformable

wex

Numeric height scale that transforms the distribution evalution to the plotting axis value. now wex for width expansion

values

desired values to evaluate x.

nvalues

Integer number of values to use for the drawing of the violin. If NULL, set by vtype.

side

"both" puts the dist on both sides of the violin.

probs

which probabilities to draw horizontal bars across.

...

Additional arguments to pass to polygon or rect.

dist_values

x and y distribution values.

violin_values

x and y violin values.

xvals

x values

minn, maxn, nrf

min and max for n and the n reduction factor

Value

violin_location: data.frame of x and y to locate the violin dist_values: data.frame of x and y to from the distribution violin_values: data.frame of x and y to plot


dapperstats/bbplot documentation built on June 11, 2022, 8:38 p.m.