From b542e4eed21149e4e5066be2522acf642426b051 Mon Sep 17 00:00:00 2001
From: olivroy <olivierroy71@hotmail.com>
Date: Fri, 28 Jun 2024 12:16:00 -0400
Subject: [PATCH] specify argument names in ggplot2 call (name existed before
 3.5.0, so no need to depend on ggplot2 3.5.0) (no need to specify
 `scale_name`?

---
 R/ggplot2.R | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/R/ggplot2.R b/R/ggplot2.R
index 87efcb11b..47cee4dfc 100644
--- a/R/ggplot2.R
+++ b/R/ggplot2.R
@@ -15,13 +15,13 @@ scale_x_num <- function(..., position = "bottom", guide = ggplot2::waiver(),
                         rescaler = NULL, super = NULL) {
   stopifnot(is.null(rescaler))
   stopifnot(is.null(super))
-  stopifnot(is_installed("ggplot2"))
+  check_installed("ggplot2")
   ggplot2::continuous_scale(
-    c(
+    aesthetics =  c(
       "x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final",
       "xlower", "xmiddle", "xupper"
     ),
-    "position_c", identity,
+    palette = "position_c",
     ...,
     guide = guide,
     position = position,
@@ -36,13 +36,13 @@ scale_y_num <- function(..., guide = ggplot2::waiver(),
                         rescaler = NULL, super = NULL) {
   stopifnot(is.null(rescaler))
   stopifnot(is.null(super))
-  stopifnot(is_installed("ggplot2"))
+  check_installed("ggplot2")
   ggplot2::continuous_scale(
-    c(
+    aesthetics = c(
       "y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final",
       "lower", "middle", "upper"
     ),
-    "position_c", identity,
+    palette = "position_c",
     ...,
     guide = guide,
     rescaler = scales::rescale,