blq_trans: A transform for ggplot2 with data that may be below the lower...

View source: R/trans_blq.R

blq_transR Documentation

A transform for ggplot2 with data that may be below the lower limit of quantification

Description

If the lloq is not provided, it will be estimated from the data as the minimum value above zero.

Usage

blq_trans(lloq, x, multiplier = 0.5, lloq_text)

blq_log_trans(lloq, x, multiplier = 0.5, base = 10, lloq_text)

Arguments

lloq

The value of the lower limit of quantification as a numeric scalar

x

(only used if lloq is missing), the data for lloq estimation.

multiplier

When data are < lloq, they are replaced by lloq*multiplier for display.

lloq_text

The text to use on the axis to indicate values < lloq. It will be automatically set to paste0("<", lloq) if missing.

base

The base for the logarithm

Value

A "trans" object based on the scales package for BLQ data.

Functions

  • blq_log_trans(): Log-scale transformation with BLQ

See Also

Other BLQ Transformation: breaks_blq_general(), estimate_lloq(), ftrans_blq_linear(), itrans_blq_linear(), label_blq()

Examples

## Not run: 
library(ggplot2)
ggplot(data=data.frame(x=1:10, y=1:10), aes(x=x, y=y)) +
  geom_point()

ggplot(data=data.frame(x=1:10, y=1:10), aes(x=x, y=y)) +
  geom_point() +
  scale_x_continuous(trans=blq_trans(lloq=3))

ggplot(data=data.frame(x=1:10, y=1:10), aes(x=x, y=y)) +
  geom_point() +
  scale_x_continuous(trans=blq_log10_trans(lloq=3))

## End(Not run)

kestrel99/occamsPmx documentation built on Feb. 25, 2023, 8:39 a.m.