rplots: Box & Violin Plots

View source: R/rplots.h.R

rplotsR Documentation

Box & Violin Plots

Description

Box & Violin Plots

Usage

rplots(
  data,
  vars,
  splitBy = NULL,
  violin = TRUE,
  boxplot = FALSE,
  dot = TRUE,
  dotType = "stack"
)

Arguments

data

the data as a data frame

vars

a vector of strings naming the variables in data of interest

splitBy

a string naming the variable in data to split the data by

violin

TRUE (default) or FALSE, provide violin plots

boxplot

TRUE or FALSE (default), provide box plots

dot

TRUE (default) or FALSE, plot each measurement as a dot

dotType

'jitter' or 'stack' (default); whether data dots are jittered or stacked

Value

A results object containing:

results$plots an array of images

Examples

data('eurosoccer', package='WRS2')

# violin plots

walrus::rplots(
    data = eurosoccer,
    vars = "GoalsGame",
    splitBy = "League")


# box plots

walrus::rplots(
    data = eurosoccer,
    vars = "GoalsGame",
    splitBy = "League",
    violin = FALSE,
    boxplot = TRUE,
    dot = FALSE)


jamovi/walrus documentation built on July 21, 2023, 7:31 p.m.