diff --git a/R/stat-boxplot.R b/R/stat-boxplot.R index ff51b8354d..4c657023f3 100644 --- a/R/stat-boxplot.R +++ b/R/stat-boxplot.R @@ -25,8 +25,8 @@ StatBoxplot <- ggproto("StatBoxplot", Stat, group_has_equal = TRUE, main_is_optional = TRUE, default = NA) - - if (is.na(params$flipped_aes)) { + + if (is.na(params$flipped_aes) && any(c("x", "y") %in% names(data))) { cli::cli_warn("Orientation is not uniquely specified when both the x and y aesthetics are continuous. Picking default orientation 'x'.") params$flipped_aes <- FALSE } diff --git a/man/resolution.Rd b/man/resolution.Rd index 0207545570..580a13ca60 100644 --- a/man/resolution.Rd +++ b/man/resolution.Rd @@ -19,7 +19,8 @@ having a resolution of 1?} The resolution is the smallest non-zero distance between adjacent values. If there is only one unique value, then the resolution is defined to be one. If x is an integer vector, then it is assumed to represent a -discrete variable, and the resolution is 1. +discrete variable, and the resolution is 1. If the differences are all smaller +than the tolerance, set resolution to 1. } \examples{ resolution(1:10)