ggplot2-geoms: ggplot2 Geometric Objects

Description Usage Arguments Value basejump_geom_abline basejump_geom_label basejump_geom_label_average basejump_geom_label_repel See Also Examples

Description

Convenience functions with modified defaults for ggplot2.

Usage

1
2
3
4
5
6
7
8
9
basejump_geom_abline(xintercept = NULL, yintercept = NULL)

basejump_geom_label(data = NULL, mapping = NULL, ...)

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

basejump_geom_label_repel(data = NULL, mapping = NULL, color = NULL,
  size = 4L, ...)

Arguments

xintercept, yintercept

scalar numeric denoting x- or y-axis cutoff. Specify one but not both.

data

data.frame. Data.

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

...

Other arguments passed on to layer(). These are often aesthetics, used to set an aesthetic to a fixed value, like colour = "red" or size = 3. They may also be parameters to the paired geom/stat.

col

string. Column name.

fun

string. Function name to use for average calculation. Currently supports "mean" or "median".

digits

scalar integer. Number of significant digits to use. Defaults to rounded.

color

string. Text color (e.g. "orange").

size

scalar integer. Font size.

Value

ggproto.

basejump_geom_abline

Horizontal or vertical cutoff line.

basejump_geom_label

Modified version of ggplot2::geom_label().

basejump_geom_label_average

Add average labels to a plot. For example, col can be nGene. Median or mean values are always calculated per sample (sampleName).

basejump_geom_label_repel

Repulsive textual annotations. Modified basejump version of ggrepel::geom_label_repel(). If advanced customization of the text labels is required, simply use the ggrepel version instead.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## basejump_geom_abline ====
## x-axis line
geom <- basejump_geom_abline(xintercept = 1L)
geom

## y-axis line
geom <- basejump_geom_abline(yintercept = 1L)
geom

## basejump_geom_label ====
geom <- basejump_geom_label()
geom

## basejump_geom_label_average ====
geom <- basejump_geom_label_average(
    data = tibble::tibble(
        sampleName = rep(c("sample1", "sample2"), times = 4L),
        counts = seq_len(8L)
    ),
    col = "counts",
    fun = "mean"
)
geom

## basejump_geom_label_repel ====
geom <- basejump_geom_label_repel()
geom

steinbaugh/basejump.plots documentation built on Nov. 5, 2018, 10:36 p.m.