Learn R Programming

scUtils (version 0.1.0)

closed_breaks_log2: Closed breaks for log scale

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

closed_breaks_log2(lims)

Arguments

lims

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

Value

Numeric vector with breaks.

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.

See Also

closed_labels

Examples

Run this code
# NOT RUN {
# closed breaks include maximum, breaks_log do not:
closed_breaks_log2(lims = c(.01, 977.1))
scales::breaks_log()(c(.01, 977.1))
# }

Run the code above in your browser using DataLab