Skip to content

Commit

Permalink
ensure resolution() works with units
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Dec 23, 2023
1 parent 40d71b3 commit c6b2b6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/utilities-resolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#' resolution(c(2, 10, 20, 50))
#' resolution(c(2L, 10L, 20L, 50L))
resolution <- function(x, zero = TRUE) {
if (is.unit(x)) {
x <- native_units(x)
}
if (is.integer(x) || is_mapped_discrete(x) ||
zero_range(range(x, na.rm = TRUE))) {
return(1)
Expand Down

0 comments on commit c6b2b6a

Please sign in to comment.