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())