qboxplot: qboxplot

View source: R/ggExpress.R

qboxplotR Documentation

qboxplot

Description

Draw and save a boxplot

Usage

qboxplot(
  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,
  outlier.shape = NULL,
  stat.test = TRUE,
  stat.method = NULL,
  stat.label.y.npc = "top",
  stat.label.x = NULL,
  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),
  ylab = NULL,
  logY = FALSE,
  annotation_logticks_Y = logY,
  xlab.angle = 90,
  hline = FALSE,
  vline = FALSE,
  plot = TRUE,
  save = TRUE,
  mdlink = MarkdownHelpers::unless.specified("b.mdlink", def = FALSE),
  grid = "y",
  max.categ = 100,
  add = NULL,
  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

The title of the plot and the name of the file (unless specified in filename).

subtitle

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

suffix

Optional suffix added to the plotname. 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,

outlier.shape

outlier shape. NA to hide.

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).

ylab

Y-axis label. Default: NULL.

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.

plot

Display 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.

add

Add additional graphical elements to the plot. Default: NULL.

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")]
qboxplot(ToothLen.by.Dose)

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