From 876cce6a3142b8b83586846da319f6c7231f9019 Mon Sep 17 00:00:00 2001 From: MaxAtoms <7847075+MaxAtoms@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:23:09 +0100 Subject: [PATCH 1/4] Document vector passing to position_nudge --- R/position-nudge.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/position-nudge.R b/R/position-nudge.R index 6bf8a81f01..37f4e1b61f 100644 --- a/R/position-nudge.R +++ b/R/position-nudge.R @@ -27,6 +27,11 @@ #' ggplot(df, aes(x, y)) + #' geom_point() + #' geom_text(aes(label = y), nudge_y = -0.1) +#' +#' # For each text individually +#' ggplot(df, aes(x, y)) + +#' geom_point() + +#' geom_text(aes(label = y), nudge_y = c(-0.1, 0.1, -0.1, 0.1)) position_nudge <- function(x = NULL, y = NULL) { ggproto(NULL, PositionNudge, x = x, From 7d5081e9cf24fc6cbe159fb612b5fc12187a5f8d Mon Sep 17 00:00:00 2001 From: MaxAtoms <7847075+MaxAtoms@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:18:33 +0100 Subject: [PATCH 2/4] Put nudge_y into aes call As discussed in #6355. --- R/position-nudge.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/position-nudge.R b/R/position-nudge.R index 37f4e1b61f..cd28360d79 100644 --- a/R/position-nudge.R +++ b/R/position-nudge.R @@ -31,7 +31,7 @@ #' # For each text individually #' ggplot(df, aes(x, y)) + #' geom_point() + -#' geom_text(aes(label = y), nudge_y = c(-0.1, 0.1, -0.1, 0.1)) +#' geom_text(aes(label = y, nudge_y = c(-0.1, 0.1, -0.1, 0.1))) position_nudge <- function(x = NULL, y = NULL) { ggproto(NULL, PositionNudge, x = x, From 0ebefa57637219f0549de64b3bfd02bb0da013bb Mon Sep 17 00:00:00 2001 From: MaxAtoms <7847075+MaxAtoms@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:19:04 +0100 Subject: [PATCH 3/4] Update documentation --- man/hmisc.Rd | 8 ++++---- man/position_nudge.Rd | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/man/hmisc.Rd b/man/hmisc.Rd index 96fd7bba30..40fe36ca41 100644 --- a/man/hmisc.Rd +++ b/man/hmisc.Rd @@ -29,10 +29,10 @@ These are wrappers around functions from \pkg{Hmisc} designed to make them easier to use with \code{\link[=stat_summary]{stat_summary()}}. See the Hmisc documentation for more details: \itemize{ -\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.cl.boot()}} -\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.cl.normal()}} -\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.sdl()}} -\item \code{\link[Hmisc:smean.sd]{Hmisc::smedian.hilow()}} +\item \code{\link[Hmisc:smean.cl.boot]{Hmisc::smean.cl.boot()}} +\item \code{\link[Hmisc:smean.cl.normal]{Hmisc::smean.cl.normal()}} +\item \code{\link[Hmisc:smean.sdl]{Hmisc::smean.sdl()}} +\item \code{\link[Hmisc:smedian.hilow]{Hmisc::smedian.hilow()}} } } \examples{ diff --git a/man/position_nudge.Rd b/man/position_nudge.Rd index 0db66c8035..89b5a14326 100644 --- a/man/position_nudge.Rd +++ b/man/position_nudge.Rd @@ -43,6 +43,11 @@ ggplot(df, aes(x, y)) + ggplot(df, aes(x, y)) + geom_point() + geom_text(aes(label = y), nudge_y = -0.1) + +# For each text individually +ggplot(df, aes(x, y)) + + geom_point() + + geom_text(aes(label = y, nudge_y = c(-0.1, 0.1, -0.1, 0.1))) } \seealso{ Other position adjustments: From 95c8432b03eda364118cf03e228d68e9a8b66be7 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Tue, 25 Feb 2025 09:52:18 +0100 Subject: [PATCH 4/4] redocument --- man/hmisc.Rd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/hmisc.Rd b/man/hmisc.Rd index 40fe36ca41..96fd7bba30 100644 --- a/man/hmisc.Rd +++ b/man/hmisc.Rd @@ -29,10 +29,10 @@ These are wrappers around functions from \pkg{Hmisc} designed to make them easier to use with \code{\link[=stat_summary]{stat_summary()}}. See the Hmisc documentation for more details: \itemize{ -\item \code{\link[Hmisc:smean.cl.boot]{Hmisc::smean.cl.boot()}} -\item \code{\link[Hmisc:smean.cl.normal]{Hmisc::smean.cl.normal()}} -\item \code{\link[Hmisc:smean.sdl]{Hmisc::smean.sdl()}} -\item \code{\link[Hmisc:smedian.hilow]{Hmisc::smedian.hilow()}} +\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.cl.boot()}} +\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.cl.normal()}} +\item \code{\link[Hmisc:smean.sd]{Hmisc::smean.sdl()}} +\item \code{\link[Hmisc:smean.sd]{Hmisc::smedian.hilow()}} } } \examples{