acid_geom_label_average: Average labels

acid_geom_label_averageR Documentation

Average labels

Description

Add average labels to a plot.

Usage

acid_geom_label_average(data, col, fun = c("mean", "median"), digits = 0L, ...)

Arguments

data

data.frame. Data frame, containing plot data.

col

character(1). Column name.

fun

character(1). Function name to use for average calculation. Currently supports mean or median.

digits

integer(1). Number of significant digits to use. Defaults to rounded.

...

Additional arguments, passed to acid_geom_label().

Details

For example, col can be nGene. Median or mean values are always calculated per sample (sampleName).

Value

Layer/ggproto.

Note

Updated 2021-06-29.

Examples

data <- data.frame(
    "sampleName" = rep(c("sample1", "sample2"), times = 4L),
    "counts" = seq_len(8L)
)
geom <- acid_geom_label_average(
    data = data,
    col = "counts",
    fun = "mean"
)
print(geom)

acidgenomics/minimalism documentation built on April 1, 2024, 10:34 a.m.