make_xlim: Create xlim

View source: R/utils.R

make_xlimR Documentation

Create xlim

Description

Create xlim based on value ranges.

Usage

make_xlim(
  xlim = NULL,
  lower,
  upper,
  ref_line = ifelse(x_trans %in% c("log", "log2", "log10"), 1, 0),
  ticks_at = NULL,
  x_trans = "none"
)

Arguments

xlim

Limits for the x axis as a vector of length 2, i.e. c(low, high). It will take the minimum and maximum of the lower and upper value if not provided. This will apply to all CI columns if provided, and will be calculated automatically for each column if not provided. This should be a list with the same length of ci_column if different xlim for different column is desired.

lower

Lower bound of the confidence interval, same as est.

upper

Upper bound of the confidence interval, same as est.

ref_line

X-axis coordinates of zero line, default is 1. Provide an atomic vector if different reference line for each ci_column is desired.

ticks_at

Set X-axis tick-marks point. This will apply to all CI columns if provided, and will be calculated automatically for each column if not provided. This should be a list if different ticks_at for different column is desired. Although many efforts have been made to automatically get a pretty ticks break, it will not give a perfect solution, especially if 'log2' and 'log10' defined for x_trans. Please provide this value if possible.

x_trans

Change axis scale, Allowed values are one of c("none", "log", "log2", "log10"). Default is "none", no transformation will be applied. The formatted label will be used for scale = "log2" or "log10", change this in x_trans. Set this to "log" if x-axis tick marks assume values are exponential, e.g. for logistic regression (OR), survival estimates (HR), Poisson regression etc.

Value

A list


forestploter documentation built on Sept. 24, 2023, 1:07 a.m.