Natural log transformation... providing breaks on the "nel" scale
nel_trans.Rd
Natural log transformation... providing breaks on the "nel" scale
Usage
nel_trans(n = 7, base = exp(1), use_centiNel = FALSE, ...)
Arguments
- n
Scalar, target number of breaks
- base
a positive or complex number: the base with respect to which logarithms are computed. Defaults to \(e\)=
exp(1)
.- use_centiNel
Logical, should units be "centiNels" (default is "nel")
- ...
Additional arguments passed to breaking function, labeller
See also
Other transformations:
divMult_trans()
,
propDiff_trans()
Examples
dat<-data.frame(x = 1:10, y = exp(-2:7))
dat %>% ggplot2::ggplot(ggplot2::aes(x, y)) +
ggplot2::geom_point() +
ggplot2::scale_y_continuous(
trans = "nel"
, sec.axis = ggplot2::sec_axis(
labels = function(x) {x}
, trans = ~.
, breaks = c(0.1, 0.5, 1, 5, 10, 50, 100, 500, 1000)
, name = "original scale"
)
) +
ggplot2::labs(y = "nel (natural log) scale") +
ggplot2::geom_hline(yintercept = 1, linewidth = 0.2)