Skip to contents

From a data.frame, runs stats on column of interest, and returns the ggplot for it.

Usage

Utility_Behemoth(
  data,
  var,
  myfactor,
  normality = NULL,
  specifiedNormality = NULL,
  correction = "none",
  override = 0.05,
  shape_palette,
  fill_palette,
  cex = 2,
  size = 3,
  corral.width = 1,
  XAxisLevels = NULL,
  statLines = TRUE,
  statsHeight = NULL,
  showClose = TRUE,
  scalePercent = FALSE,
  keepNS = TRUE
)

Arguments

data

A data.frame object with metadata and data columns

var

The column name for your variable of interest

myfactor

The column name for your column containing your factor to group by

normality

The Normality test to be applied, "dagostino" or "shapiro". Default NULL

specifiedNormality

Default NULL leading to non-parametric, can switch by specifying "parametric" or "nonparametric".

correction

Multiple comparison correction argument, default is set at "none"

override

Internal, default 0.05. Set to 0.99 to force pairwise comparison in anova/kw.

shape_palette

Palette corresponding to factor levels, designating each's shape

fill_palette

Palette corresponding to factor levels, designating each's fill

cex

The width of the ggbeeswarm bin

size

Size for the ggbeeswarm circles.

corral.width

width of corral bin argument for beeswarm.

XAxisLevels

Provide list marker names correct order for x-axis reordering, default NULL

statLines

Default is TRUE, otherwise skips plotting pvalue and brackets

statsHeight

Default is NULL, when provided, sets stat line y-axis height.

showClose

Default is TRUE, displays pvalues between 0.05 and 0.10 instead returning n.s

scalePercent

Default is FALSE, scales 0 to 1 to 0-100

keepNS

Default is TRUE, when false, removes ns from the plots.

Value

A ggplot2 object for the corresponding data of interest.

Examples


shape_ptype <- c("HU" = 22, "HEU-lo" = 21, "HEU-hi" = 21)
fill_ptype <- c("HU" = "white", "HEU-lo" = "darkgray", "HEU-hi" = "black")

File_Location <- system.file("extdata", package = "Coereba")
panelPath <- file.path(File_Location, "ILTPanelTetramer.csv")
binaryPath <- file.path(File_Location, "HeatmapExample.csv")
dataPath <- file.path(File_Location, "ReadyFileExample.csv")
panelData <- read.csv(panelPath, check.names=FALSE)
binaryData <- read.csv(binaryPath, check.names=FALSE)
dataData <- read.csv(dataPath, check.names=FALSE)

All <- Coereba_MarkerExpressions(data=dataData, binary=binaryData,
 panel=panelData, starter="SparkBlue550")

Plot <- Utility_Behemoth(data=All, var="CD62L", myfactor="ptype",
 normality="dagostino", correction="none", shape_palette=shape_ptype,
 fill_palette=fill_ptype, XAxisLevels = c("HU", "HEU-lo", "HEU-hi"))
#> Error in if (at$p.value[1] < override) {    subset_data <- subset(data, select = c(var, myfactor))    ptt <- tidy(pairwise.t.test(subset_data[[var]], subset_data[[myfactor]],         p.adjust.method = correction))    ptt$method <- "Pairwise t-test"    ptt} else (at): missing value where TRUE/FALSE needed