superplot_func: Superplot with violin and scatter plot

View source: R/superplot_func.R

superplot_funcR Documentation

Superplot with violin and scatter plot

Description

Make a violin and scatter plot with aggregated data at different levels (animal, cell or waves). The layers are constructed in this order: (wave/cell) violin layer -> (wave/cell) small dot layer -> (Animal) large dot layer. Note: this function is depending on other functions to build the multiples layers up.

Usage

superplot_func(
  dataset,
  yaxe,
  xaxe = "Animal",
  base_violin = "cells",
  dot_layer = "cells",
  animal_layer = TRUE,
  wave_size = 2,
  wave_alpha = 0.4,
  cell_size = 2.5,
  cell_alpha = 0.4,
  animal_size = 5,
  animal_alpha = 0.6,
  base_font_size = 15,
  jitter_width_wave = 3,
  jitter_width_cell = 3,
  jitter_width_animal = 3,
  ...
)

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 dependent variable for piloting. set to default to "Animal".

base_violin

A string. Which base plot would you like to plot as a violin plot?. Options are: 1. waves, 2. cells. Default to cells.

dot_layer

A string. Which data would you like to see in the next layer?. Options are: 1. waves, 2. cells, 3. waves_and_cells, 4. none. Default to cells.

animal_layer

A logic value. Would you like to add the Animal dot layer? default to TRUE.

wave_size

A double. Value assigned to the size of the dots. Default to 2.

wave_alpha

A double. Value assigned to the transparency of the dots. Default to 0.4.

cell_size

A double. Value assigned to the size of the dots. Default to 2.5.

cell_alpha

A double. Value assigned to the transparency of the dots. Default to 0.4.

animal_size

A double. Value assigned to the size of the dots. Default to 5.

animal_alpha

A double. Value assigned to the transparency of the dots. Default to 0.6.

base_font_size

A integer. Modify the size of the fonts. Default to 15.

jitter_width_wave

Double. Determine the size of spread of the scatter points for waves.

jitter_width_cell

Double. Determine the size of spread of the scatter points for cells.

jitter_width_animal

Double. Determine the size of spread of the scatter points for animal.

...

Pass additional parameters to the internal plot layers.

Value

A ggplot object with a superplot indicating multiples layers of Animals, cell or waves.

Examples

# the example is missing

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