lrr_plot: Prepare log relative risk values for plotting with a...

View source: R/lrr_plot.R

lrr_plotR Documentation

Prepare log relative risk values for plotting with a diverging color palette

Description

Internal function to convert an object of class 'im' to values readable by image.plot function within the rrs and lotrrs functions.

Usage

lrr_plot(
  input,
  cols,
  midpoint = 0,
  lower_lrr = NULL,
  upper_lrr = NULL,
  digits = 1
)

Arguments

input

An object of class 'rrs' from the rrs or lotrrs function.

cols

Character string of length three (3) specifying the colors for plotting: 1) numerator, 2) insignificant, and 3) denominator from the rrs or lotrrs function.

midpoint

Numeric. The value to center the diverging color palette.

lower_lrr

Numeric. The lower value to concatenate the color key. The default (NULL) uses the minimum value from input.

upper_lrr

Numeric. The upper value to concatenate the color key. The default (NULL) uses the maximum value from input.

digits

Integer. The number of significant digits for the labels using the round function (default is 1).

Value

An object of class 'list'. This is a named list with the following components:

v

An object of class 'SpatRaster' for the estimated gating surface.

cols

An object of class 'vector', returns diverging color palette values.

breaks

An object of class 'vector', returns diverging color palette breaks.

at

An object of class 'vector', returns legend breaks.

labels

An object of class 'vector', returns legend labels.


Waller-SUSAN/gateR documentation built on Feb. 5, 2024, 12:54 p.m.