Skip to content

Commit

Permalink
Mention transformation must be strictly monotonic
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Feb 28, 2024
1 parent bc3e401 commit f5acd7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions R/axis-secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' secondary axis, positioned opposite of the primary axis. All secondary
#' axes must be based on a one-to-one transformation of the primary axes.
#'
#' @param transform A formula or function of transformation
#' @param transform A formula or function of a strictly monotonic transformation
#'
#' @param trans `r lifecycle::badge("deprecated")`
#'
Expand Down Expand Up @@ -205,7 +205,9 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,

# Test for monotonicity
if (!is_unique(sign(diff(full_range))))
cli::cli_abort("Transformation for secondary axes must be monotonic.")
cli::cli_abort(
"Transformation for secondary axes must be strictly monotonic."
)
},

break_info = function(self, range, scale) {
Expand Down
2 changes: 1 addition & 1 deletion man/sec_axis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/sec-axis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

---

Transformation for secondary axes must be monotonic.
Transformation for secondary axes must be strictly monotonic.

0 comments on commit f5acd7c

Please sign in to comment.