xgx_scale_x_reverselog10: Reverse-log transform for the x scale.

View source: R/xgx_scale_x_reverselog10.R

xgx_scale_x_reverselog10R Documentation

Reverse-log transform for the x scale.

Description

xgx_scale_x_reverselog10 is designed to be used with data that approaches 100 A common example is receptor occupancy in drug development. It is used when you want even spacing between 90, 99, 99.9, etc.

Usage

xgx_scale_x_reverselog10(labels = NULL, accuracy = NULL, ...)

Arguments

labels

if NULL, then the default is to use scales::percent()

accuracy

if NULL, then use the the default as specified by scales::percent() to round to the hundredths place, set accuracy 0.01

...

other parameters passed to scale_x_continuous

Value

ggplot2 compatible scale object

Examples

conc <- 10^(seq(-3, 3, by = 0.1))
ec50 <- 1
data <- data.frame(concentration = conc, 
                   bound_receptor = 1 * conc / (conc + ec50))
ggplot2::ggplot(data, ggplot2::aes(y = concentration, x = bound_receptor)) +
  ggplot2::geom_point() +
  ggplot2::geom_line() +
  xgx_scale_y_log10() +
  xgx_scale_x_reverselog10()
 

xgxr documentation built on March 31, 2023, 11:46 p.m.