Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trans_reverser

Reverse a transformation


Description

While the scales package export a reverse_trans object it does not allow for reversing of already transformed ranged - e.g. a reverse exp transformation is not possible. trans_reverser takes a trans object or something coercible to one and creates a reverse version of it.

Usage

trans_reverser(trans)

Arguments

trans

A trans object or an object that can be converted to one using scales::as.trans()

Value

A trans object

Examples

# Lets make a plot
p <- ggplot() +
  geom_line(aes(x = 1:10, y = 1:10))

# scales already have a reverse trans
p + scale_x_continuous(trans = 'reverse')

# But what if you wanted to reverse an already log transformed scale?
p + scale_x_continuous(trans = trans_reverser('log'))

ggforce

Accelerating 'ggplot2'

v0.3.3
MIT + file LICENSE
Authors
Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.