closed_breaks_log2: Closed breaks for log scale

Description Usage Arguments Details Value See Also Examples

View source: R/plots.R

Description

Finds breaks that are powers of 2, and forces inclusion of upper and lower limits (displaying the closed interval). Including limits specifically is particularly useful for ggplot2's color/fill, as it emphasizes the meaning of maximal/minimal color intensities (see examples).

Usage

1

Arguments

lims

Vector with lower and upper limits (in that order) of the data that you want breaks for.

Details

The feat function uses closed_breaks_log2 to color by gene expression, where the maximal expression gives valuable intuition for a gene's overall expression strength. For x- or y-axis (scale_*_log10), I still recommend breaks_log from the scales package.

Value

Numeric vector with breaks.

See Also

closed_labels

Examples

1
2
3
# closed breaks include maximum, breaks_log do not:
closed_breaks_log2(lims = c(.01, 977.1))
scales::breaks_log()(c(.01, 977.1))

scUtils documentation built on July 2, 2020, 4:05 a.m.