check_plot_scale: Look at the range of the data for a plot and use it to...

View source: R/plot_shared.R

check_plot_scaleR Documentation

Look at the range of the data for a plot and use it to suggest if a plot should be on log scale.

Description

There are a bunch of plots which often-but-not-always benefit from being displayed on a log scale rather than base 10. This is a quick and dirty heuristic which suggests the appropriate scale. If the data 'should' be on the log scale and it has 0s, then they are moved to 1 so that when logged they will return to 0. Similarly, if there are negative numbers and the intended scale is log, then this will set values less than 0 to zero to avoid imaginary numbers.

Usage

check_plot_scale(data, scale = NULL, max_data = 10000, min_data = 10)

Arguments

data

Data to plot.

scale

If known, this will be used to define what (if any) values to change.

max_data

Define the upper limit for the heuristic.

min_data

Define the lower limit for the heuristic.


elsayed-lab/hpgltools documentation built on April 8, 2024, 1:30 a.m.