From 40cfe30fc66ef85be9f8dcccfa94a2ae609b7527 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 18 Dec 2023 14:42:55 +0100 Subject: [PATCH 1/2] skip AsIs scale type --- R/scale-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/scale-type.R b/R/scale-type.R index 2feaa69c82..9ad1b9775d 100644 --- a/R/scale-type.R +++ b/R/scale-type.R @@ -2,7 +2,7 @@ find_scale <- function(aes, x, env = parent.frame()) { # Inf is ambiguous; it can be used either with continuous scales or with # discrete scales, so just skip in the hope that we will have a better guess # with the other layers - if (is.null(x) || (is_atomic(x) && all(is.infinite(x)))) { + if (is.null(x) || (is_atomic(x) && all(is.infinite(x))) || inherits(x, "AsIs")) { return(NULL) } From 46d376c059d1e1739ba85d3f6faf1a8b57e04666 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 18 Dec 2023 14:43:08 +0100 Subject: [PATCH 2/2] remove `scale_type.AsIs` method --- NAMESPACE | 1 - R/scale-type.R | 3 --- 2 files changed, 4 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 967573b174..176d9e79af 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -112,7 +112,6 @@ S3method(print,ggproto_method) S3method(print,rel) S3method(print,theme) S3method(print,uneval) -S3method(scale_type,AsIs) S3method(scale_type,Date) S3method(scale_type,POSIXt) S3method(scale_type,character) diff --git a/R/scale-type.R b/R/scale-type.R index 9ad1b9775d..e9f3b8cc9b 100644 --- a/R/scale-type.R +++ b/R/scale-type.R @@ -70,9 +70,6 @@ scale_type.default <- function(x) { #' @export scale_type.list <- function(x) "identity" -#' @export -scale_type.AsIs <- function(x) "identity" - #' @export scale_type.logical <- function(x) "discrete"