From fc6d0a726d9a1ed1c71eddd09fa7b6a6171edc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Fri, 25 Jul 2025 18:34:32 +0100 Subject: [PATCH] feat: user 'ggplot2::annotate' for single annotation --- R/tm_a_regression.R | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index e298e8205..983b9b37b 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -830,18 +830,15 @@ srv_a_regression <- function(id, color = "red", linetype = "dashed" ) + - ggplot2::geom_text( - ggplot2::aes( - x = 0, - y = mean(data$.cooksd, na.rm = TRUE), - label = paste("mu", "=", round(mean(data$.cooksd, na.rm = TRUE), 4)), - vjust = -1, - hjust = 0, - color = "red", - angle = 90 - ), - parse = TRUE, - show.legend = FALSE + ggplot2::annotate( + geom = "text", + x = 0, + y = mean(data$.cooksd, na.rm = TRUE), + label = paste("mu", "=", round(mean(data$.cooksd, na.rm = TRUE), 4)), + vjust = -1, + hjust = 0, + color = "red", + angle = 90 ) + outlier_label, env = list(plot = plot, outlier = input$outlier, outlier_label = outlier_label())