superbPlot.pointjitter: superbPlot point-and-jitter dots layout

View source: R/functionsPlotting_base.R

superbPlot.pointjitterR Documentation

superbPlot point-and-jitter dots layout

Description

superbPlot comes with a few built-in templates for making the final plots. All produces ggplot objects that can be further customized. Additionally, it is possible to add custom-make templates (see vignette 6). The functions, to be "superbPlot-compatible", must have these parameters:

Usage

superbPlot.pointjitter(
  summarydata,
  xfactor,
  groupingfactor,
  addfactors,
  rawdata,
  pointParams = list(),
  jitterParams = list(),
  errorbarParams = list(),
  facetParams = list(),
  xAsFactor = TRUE
)

Arguments

summarydata

a data.frame with columns "center", "lowerwidth" and "upperwidth" for each level of the factors;

xfactor

a string with the name of the column where the factor going on the horizontal axis is given;

groupingfactor

a string with the name of the column for which the data will be grouped on the plot;

addfactors

a string with up to two additional factors to make the rows and columns panels, in the form "fact1 ~ fact2";

rawdata

always contains "DV" for each participants and each level of the factors

pointParams

(optional) list of graphic directives that are sent to the geom_bar layer

jitterParams

(optional) list of graphic directives that are sent to the geom_bar layer

errorbarParams

(optional) list of graphic directives that are sent to the geom_superberrorbar layer

facetParams

(optional) list of graphic directives that are sent to the facet_grid layer

xAsFactor

(optional) Boolean to indicate if the factor on the horizontal should continuous or discrete (default is discrete)

Value

a ggplot object

Examples

# This will make a plot with jittered points, aka dot plots
superbPlot(ToothGrowth, 
   BSFactors = c("dose","supp"), variables = "len",
   plotStyle="pointjitter" 
)

# if you extract the data with superbData, you can 
# run this layout directly
#processedData <- superbData(ToothGrowth, 
#   BSFactors = c("dose","supp"), variables = "len"
#)
#
#superbPlot.pointjitter(processedData$summaryStatistic,
#   "dose",
#   "supp",
#   ".~.",
#   processedData$rawData)


superb documentation built on Jan. 23, 2023, 5:44 p.m.