From beb08e5953b2e26f7707aa72ab915b07f5fbbe21 Mon Sep 17 00:00:00 2001 From: agmurray Date: Thu, 15 Aug 2024 10:52:16 -0700 Subject: [PATCH 1/3] Added text to show how to add color to legends for all levels, even when no data for some levels exists. Fixes #5869 --- R/layer.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/layer.R b/R/layer.R index 8b4621bde2..fc28ba94e1 100644 --- a/R/layer.R +++ b/R/layer.R @@ -58,7 +58,9 @@ #' `NA`, the default, includes if any aesthetics are mapped. #' `FALSE` never includes, and `TRUE` always includes. #' It can also be a named logical vector to finely select the aesthetics to -#' display. +#' display. This option can be used to include color for all levels, even +#' when no data exists, use `TRUE`. If 'FALSE', all levels are shown in legend, +#' but omitting colors for unobserved levels. #' @param inherit.aes If `FALSE`, overrides the default aesthetics, #' rather than combining with them. This is most useful for helper functions #' that define both data and aesthetics and shouldn't inherit behaviour from From 85478e39c04e65e7d3b96e9081254b626006f2b0 Mon Sep 17 00:00:00 2001 From: agmurray Date: Thu, 15 Aug 2024 11:44:11 -0700 Subject: [PATCH 2/3] Update R/layer.R edits from Tuen Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> --- R/layer.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/layer.R b/R/layer.R index fc28ba94e1..7fc53571ef 100644 --- a/R/layer.R +++ b/R/layer.R @@ -58,9 +58,9 @@ #' `NA`, the default, includes if any aesthetics are mapped. #' `FALSE` never includes, and `TRUE` always includes. #' It can also be a named logical vector to finely select the aesthetics to -#' display. This option can be used to include color for all levels, even -#' when no data exists, use `TRUE`. If 'FALSE', all levels are shown in legend, -#' but omitting colors for unobserved levels. +#' display. To include legend keys for all levels, even +#' when no data exists, use `TRUE`. If `NA`, all levels are shown in legend, +#' but unobserved levels are omitted. #' @param inherit.aes If `FALSE`, overrides the default aesthetics, #' rather than combining with them. This is most useful for helper functions #' that define both data and aesthetics and shouldn't inherit behaviour from From d9439eb09deda746ee4b22887ed989ea72e1fe4e Mon Sep 17 00:00:00 2001 From: agmurray Date: Thu, 15 Aug 2024 11:47:38 -0700 Subject: [PATCH 3/3] Includes edits from Teun to clarify language and ran `devtools::document()` --- man/borders.Rd | 4 +++- man/geom_abline.Rd | 4 +++- man/geom_bar.Rd | 4 +++- man/geom_bin_2d.Rd | 4 +++- man/geom_blank.Rd | 4 +++- man/geom_boxplot.Rd | 4 +++- man/geom_contour.Rd | 4 +++- man/geom_count.Rd | 4 +++- man/geom_density.Rd | 4 +++- man/geom_density_2d.Rd | 4 +++- man/geom_dotplot.Rd | 4 +++- man/geom_errorbarh.Rd | 4 +++- man/geom_function.Rd | 4 +++- man/geom_hex.Rd | 4 +++- man/geom_histogram.Rd | 4 +++- man/geom_jitter.Rd | 4 +++- man/geom_linerange.Rd | 4 +++- man/geom_map.Rd | 4 +++- man/geom_path.Rd | 4 +++- man/geom_point.Rd | 4 +++- man/geom_polygon.Rd | 4 +++- man/geom_qq.Rd | 4 +++- man/geom_quantile.Rd | 4 +++- man/geom_ribbon.Rd | 4 +++- man/geom_rug.Rd | 4 +++- man/geom_segment.Rd | 4 +++- man/geom_smooth.Rd | 4 +++- man/geom_spoke.Rd | 4 +++- man/geom_text.Rd | 4 +++- man/geom_tile.Rd | 4 +++- man/geom_violin.Rd | 4 +++- man/layer.Rd | 4 +++- man/layer_sf.Rd | 4 +++- man/stat_ecdf.Rd | 4 +++- man/stat_ellipse.Rd | 4 +++- man/stat_identity.Rd | 4 +++- man/stat_sf_coordinates.Rd | 4 +++- man/stat_summary.Rd | 4 +++- man/stat_summary_2d.Rd | 4 +++- man/stat_unique.Rd | 4 +++- 40 files changed, 120 insertions(+), 40 deletions(-) diff --git a/man/borders.Rd b/man/borders.Rd index 1fcb3f2630..2fa16916e9 100644 --- a/man/borders.Rd +++ b/man/borders.Rd @@ -79,7 +79,9 @@ to use \code{position_jitter()}, give the position as \code{"jitter"}. \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{\code{inherit.aes}}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from diff --git a/man/geom_abline.Rd b/man/geom_abline.Rd index 8fd63ae8e0..0c3bd12b24 100644 --- a/man/geom_abline.Rd +++ b/man/geom_abline.Rd @@ -89,7 +89,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{position}{A position adjustment to use on the data for this layer. This can be used in various ways, including to prevent overplotting and diff --git a/man/geom_bar.Rd b/man/geom_bar.Rd index 4f8196b4c1..6c8c67cc19 100644 --- a/man/geom_bar.Rd +++ b/man/geom_bar.Rd @@ -122,7 +122,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_bin_2d.Rd b/man/geom_bin_2d.Rd index 38341bf063..fa3b32b4ce 100644 --- a/man/geom_bin_2d.Rd +++ b/man/geom_bin_2d.Rd @@ -101,7 +101,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_blank.Rd b/man/geom_blank.Rd index c547845953..1f02b9cbc6 100644 --- a/man/geom_blank.Rd +++ b/man/geom_blank.Rd @@ -93,7 +93,9 @@ lists which parameters it can accept. \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_boxplot.Rd b/man/geom_boxplot.Rd index e995aa6635..918b082d4b 100644 --- a/man/geom_boxplot.Rd +++ b/man/geom_boxplot.Rd @@ -145,7 +145,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_contour.Rd b/man/geom_contour.Rd index d53e300a79..72114072e2 100644 --- a/man/geom_contour.Rd +++ b/man/geom_contour.Rd @@ -169,7 +169,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_count.Rd b/man/geom_count.Rd index 370db388ed..1b925e7450 100644 --- a/man/geom_count.Rd +++ b/man/geom_count.Rd @@ -96,7 +96,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_density.Rd b/man/geom_density.Rd index 86bf57d6e9..58f6dae9e2 100644 --- a/man/geom_density.Rd +++ b/man/geom_density.Rd @@ -110,7 +110,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_density_2d.Rd b/man/geom_density_2d.Rd index 68f1353262..f063cfdd4a 100644 --- a/man/geom_density_2d.Rd +++ b/man/geom_density_2d.Rd @@ -138,7 +138,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_dotplot.Rd b/man/geom_dotplot.Rd index 1a57df3233..ff7f30a4fc 100644 --- a/man/geom_dotplot.Rd +++ b/man/geom_dotplot.Rd @@ -131,7 +131,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_errorbarh.Rd b/man/geom_errorbarh.Rd index f72ccd5a2a..21a4c79f5c 100644 --- a/man/geom_errorbarh.Rd +++ b/man/geom_errorbarh.Rd @@ -97,7 +97,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_function.Rd b/man/geom_function.Rd index 529f552d11..451c779003 100644 --- a/man/geom_function.Rd +++ b/man/geom_function.Rd @@ -100,7 +100,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_hex.Rd b/man/geom_hex.Rd index 1876bf19fe..11dbdb1f87 100644 --- a/man/geom_hex.Rd +++ b/man/geom_hex.Rd @@ -99,7 +99,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_histogram.Rd b/man/geom_histogram.Rd index f60ec4b1f5..e49c8a4eea 100644 --- a/man/geom_histogram.Rd +++ b/man/geom_histogram.Rd @@ -120,7 +120,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_jitter.Rd b/man/geom_jitter.Rd index 4ca3577792..2fa8acf555 100644 --- a/man/geom_jitter.Rd +++ b/man/geom_jitter.Rd @@ -108,7 +108,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_linerange.Rd b/man/geom_linerange.Rd index 03eb82f896..0d70775f6d 100644 --- a/man/geom_linerange.Rd +++ b/man/geom_linerange.Rd @@ -149,7 +149,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_map.Rd b/man/geom_map.Rd index f6aaf69dca..6a634702e9 100644 --- a/man/geom_map.Rd +++ b/man/geom_map.Rd @@ -89,7 +89,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_path.Rd b/man/geom_path.Rd index 239b7dc0c6..8c530e4d33 100644 --- a/man/geom_path.Rd +++ b/man/geom_path.Rd @@ -140,7 +140,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_point.Rd b/man/geom_point.Rd index b7e6a0d5d2..762d4a1f80 100644 --- a/man/geom_point.Rd +++ b/man/geom_point.Rd @@ -97,7 +97,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_polygon.Rd b/man/geom_polygon.Rd index 5e69742056..22670cbb8b 100644 --- a/man/geom_polygon.Rd +++ b/man/geom_polygon.Rd @@ -103,7 +103,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_qq.Rd b/man/geom_qq.Rd index 62ff813561..d450b3d948 100644 --- a/man/geom_qq.Rd +++ b/man/geom_qq.Rd @@ -156,7 +156,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_quantile.Rd b/man/geom_quantile.Rd index a3aa6ac3c0..568c33e970 100644 --- a/man/geom_quantile.Rd +++ b/man/geom_quantile.Rd @@ -109,7 +109,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_ribbon.Rd b/man/geom_ribbon.Rd index 418c759f8c..2c7e805fc7 100644 --- a/man/geom_ribbon.Rd +++ b/man/geom_ribbon.Rd @@ -130,7 +130,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_rug.Rd b/man/geom_rug.Rd index db5b200b76..6e84a4d985 100644 --- a/man/geom_rug.Rd +++ b/man/geom_rug.Rd @@ -108,7 +108,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_segment.Rd b/man/geom_segment.Rd index 05ecf827e8..fc3adbbd8c 100644 --- a/man/geom_segment.Rd +++ b/man/geom_segment.Rd @@ -128,7 +128,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_smooth.Rd b/man/geom_smooth.Rd index ece17611a4..fc2787c910 100644 --- a/man/geom_smooth.Rd +++ b/man/geom_smooth.Rd @@ -140,7 +140,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_spoke.Rd b/man/geom_spoke.Rd index 216686f8ec..7fe6a9d9ee 100644 --- a/man/geom_spoke.Rd +++ b/man/geom_spoke.Rd @@ -98,7 +98,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_text.Rd b/man/geom_text.Rd index 9c64a258d5..5f5dabe2d0 100644 --- a/man/geom_text.Rd +++ b/man/geom_text.Rd @@ -138,7 +138,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_tile.Rd b/man/geom_tile.Rd index ac32298ee7..326f36a2f4 100644 --- a/man/geom_tile.Rd +++ b/man/geom_tile.Rd @@ -133,7 +133,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/geom_violin.Rd b/man/geom_violin.Rd index 4041d770c7..974d1c5bdc 100644 --- a/man/geom_violin.Rd +++ b/man/geom_violin.Rd @@ -130,7 +130,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/layer.Rd b/man/layer.Rd index 8ce4e49715..b4070fbe2a 100644 --- a/man/layer.Rd +++ b/man/layer.Rd @@ -94,7 +94,9 @@ supplied parameters and aesthetics are understood by the \code{geom} or \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{key_glyph}{A legend key drawing function or a string providing the function name minus the \code{draw_key_} prefix. See \link{draw_key} for details.} diff --git a/man/layer_sf.Rd b/man/layer_sf.Rd index 8da9547aed..cda8db1d2e 100644 --- a/man/layer_sf.Rd +++ b/man/layer_sf.Rd @@ -92,7 +92,9 @@ supplied parameters and aesthetics are understood by the \code{geom} or \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} } \description{ The \code{layer_sf()} function is a variant of \code{\link[=layer]{layer()}} meant to be used by diff --git a/man/stat_ecdf.Rd b/man/stat_ecdf.Rd index d0941b2b56..8d92c51743 100644 --- a/man/stat_ecdf.Rd +++ b/man/stat_ecdf.Rd @@ -105,7 +105,9 @@ a warning. If \code{TRUE} silently removes missing values.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_ellipse.Rd b/man/stat_ellipse.Rd index bed871d361..138bda2e65 100644 --- a/man/stat_ellipse.Rd +++ b/man/stat_ellipse.Rd @@ -112,7 +112,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_identity.Rd b/man/stat_identity.Rd index 945eaafd87..f5dd6e1a5d 100644 --- a/man/stat_identity.Rd +++ b/man/stat_identity.Rd @@ -93,7 +93,9 @@ lists which parameters it can accept. \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_sf_coordinates.Rd b/man/stat_sf_coordinates.Rd index 35ce136a6c..1a8aef4440 100644 --- a/man/stat_sf_coordinates.Rd +++ b/man/stat_sf_coordinates.Rd @@ -72,7 +72,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_summary.Rd b/man/stat_summary.Rd index 034e11afdb..559eb437bc 100644 --- a/man/stat_summary.Rd +++ b/man/stat_summary.Rd @@ -162,7 +162,9 @@ to either \code{"x"} or \code{"y"}. See the \emph{Orientation} section for more \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_summary_2d.Rd b/man/stat_summary_2d.Rd index 464cdeacc3..9ee4604b65 100644 --- a/man/stat_summary_2d.Rd +++ b/man/stat_summary_2d.Rd @@ -132,7 +132,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions diff --git a/man/stat_unique.Rd b/man/stat_unique.Rd index 89a7e728b5..137c99f180 100644 --- a/man/stat_unique.Rd +++ b/man/stat_unique.Rd @@ -97,7 +97,9 @@ a warning. If \code{TRUE}, missing values are silently removed.} \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to -display.} +display. To include legend keys for all levels, even +when no data exists, use \code{TRUE}. If \code{NA}, all levels are shown in legend, +but unobserved levels are omitted.} \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions