From beb08e5953b2e26f7707aa72ab915b07f5fbbe21 Mon Sep 17 00:00:00 2001 From: agmurray Date: Thu, 15 Aug 2024 10:52:16 -0700 Subject: [PATCH] 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