wave_layer_vio_ggplot_func: wave_layer_vio_ggplot_func

View source: R/wave_layer_vio_ggplot_func.R

wave_layer_vio_ggplot_funcR Documentation

wave_layer_vio_ggplot_func

Description

Create a base canvas violin ggplot object. This function make single waves violin plot with the raw data that is, no aggregation on single waves for multiples cells. Note: this function is wrapped inside the final superplot function.

Usage

wave_layer_vio_ggplot_func(
  dataset,
  yaxe,
  xaxe = "Animal",
  faceted_by_1 = "Condition",
  faceted_by_2 = ".",
  y_limits,
  line_size = 1,
  trim = FALSE,
  scaled_to = "width",
  adjusted = 1
)

Arguments

dataset

A dataframe object. The dataset for analysis, eg wave kinetics or wave occurrence df.

yaxe

A string. The variable name of interest to plot.

xaxe

A string. The variable you want to compare with. Default to Animal.

faceted_by_1

A string. Grouping variables for visualization. Default to Condition.

faceted_by_2

A string. Aditional grouping variables for visualization. Default to ..

y_limits

A double. Optional paramter to set the upper y limit to your plot.

line_size

Integer. the size of the lines to display. Default to 1.

trim

Logic. shall the edges of the violin plots be cutted off?. Default to FALSE

scaled_to

Character string. If "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width.

adjusted

Double. A multiplicate bandwidth adjustment. This makes it possible to adjust the bandwidth while still using the a bandwidth estimator. For example, adjust = 1/2 means use half of the default bandwidth.

Value

A ggplot object with a violin plot canvas to add additional layers.

Examples

# the example is missing

rjlopez2/AnlysisOfWaves documentation built on Sept. 15, 2022, 2:25 p.m.