qstripchart: qstripchart

View source: R/ggExpress.R

qstripchartR Documentation

qstripchart

Description

Generates a stripchart and saves the plot for a given 2-column dataframe and offers several customizations.

Usage

qstripchart(
  df_XYcol_or_list,
  x = 1,
  y = 2,
  col = NULL,
  fill = "gold",
  plotname = FixPlotName(substitute(df_XYcol_or_list)),
  subtitle = NULL,
  suffix = NULL,
  caption = suffix,
  filename = NULL,
  ylab = NULL,
  plot = TRUE,
  add = c("violin", "mean_sd"),
  size.point = 0.2,
  stat.test = TRUE,
  stat.method = NULL,
  stat.label.y.npc = "png",
  stat.label.x = 0.75,
  palette_use = c("RdBu", "Dark2", "Set2", "jco", "npg", "aaas", "lancet", "ucscgb",
    "uchicago")[4],
  hide.legend = FALSE,
  also.pdf = TRUE,
  save.obj = FALSE,
  ext = MarkdownHelpers::ww.set.file.extension(default = "png", also_pdf = also.pdf),
  logY = FALSE,
  annotation_logticks_Y = logY,
  xlab.angle = 90,
  hline = FALSE,
  vline = FALSE,
  save = TRUE,
  mdlink = MarkdownHelpers::unless.specified("b.mdlink", def = FALSE),
  grid = "y",
  max.categ = 100,
  w = qqqAxisLength(df_XYcol_or_list),
  h = 6,
  ...
)

Arguments

df_XYcol_or_list

Data, as 2 column data frame, where col.1 is X axis, alternatively a uniquely named list ov values.

x

The index or name of the column to be plotted on the X axis. Default: 1.

y

The index or name of the column to be plotted on the Y axis. Default: 2.

col

The index or name of the column to be used for coloring the plot. Default: NULL.

fill

Fill color of the plot. Default: gold.

plotname

Name of the plot

subtitle

Optional subtitle text added below the title. Default is NULL.

suffix

Optional suffix added to the filename. Default is NULL.

caption

Optional text added to bottom right corner of the plot. Default = suffix

filename

Manually provided filename (optional). Default: parse from plotname,

ylab

Y-axis label. Default: NULL.z

plot

Display the plot.

add

Add boxplot or violin chart? Default add = c("violin", "mean_sd"), it can be "boxplot" or only "mean_sd".

size.point

Size of points

stat.test

Do a statistical test?

stat.method

stat method. NULL for default

stat.label.y.npc

stat label y position

stat.label.x

stat label x position

palette_use

GGpubr Color palette to use.

hide.legend

hide legend

also.pdf

Save plot in both png and pdf formats.

save.obj

Save the ggplot object to a file. Default: FALSE.

ext

File extension (.pdf / .png).

logY

Make Y axis log10-scale.

annotation_logticks_Y

Logical indicating whether to add annotation logticks on Y-axis. Default follows the value of logY.

xlab.angle

Rotate X-axis labels by N degree. Default: 90

hline

Draw a horizontal line on the plot.

vline

Draw a vertical line on the plot.

save

Save the plot into a file.

mdlink

Insert a .pdf and a .png image link in the markdown report, set by "path_of_report".

grid

Character indicating the axis to add gridlines. Options are 'x', 'y', or 'xy'. Default is 'y'.

max.categ

The maximum allowed number of unique categories.

w

Width of the plot.

h

Height of the plot.

...

Pass any other parameter of the corresponding plotting function(most of them should work).

Examples

data("ToothGrowth")
ToothLen.by.Dose <- ToothGrowth[, c("dose", "len")]
qstripchart(ToothLen.by.Dose)


vertesy/ggExpress documentation built on Nov. 24, 2024, 10:44 p.m.