label_outliers: Add labels to outliers in boxplot/beeswarm.

View source: R/plots.R

label_outliersR Documentation

Add labels to outliers in boxplot/beeswarm.

Description

[Experimental]

label_outliers adds a text_repel layer to an existing ggplot object. It is intended to be used with boxplots or beeswarm plots. Faceting will result in separate computations for outliers. It requires the ggrepel package.

Usage

label_outliers(
  plotbase,
  labelvar = NULL,
  coef = 1.5,
  nudge_x = 0,
  nudge_y = 0,
  color = "darkred",
  size = 3,
  hjust = 0,
  face = "bold"
)

Arguments

plotbase

ggplot object to add labels to.

labelvar

variable to use as label. If NULL, rownames or rownumbers are used.

coef

coefficient for boxplot.stats, defaults to 1.5.

nudge_x

nudge in x direction, defaults to 0.

nudge_y

nudge in y direction, defaults to 0.

color

color of labels, defaults to darkred.

size

size of labels, defaults to 3.

hjust

horizontal justification of labels, defaults to 0.

face

font face of labels, defaults to bold.

Value

A ggplot object, allowing further styling.


wrappedtools documentation built on Oct. 10, 2024, 5:07 p.m.