Skip to content

NA values are shown in gray color #44

Answered by dieghernan
Nowosad asked this question in Q&A
Discussion options

You must be logged in to vote

HI @Nowosad !

Plotting NAs is the default behaviour on ggplot2, that plots NAs with grey50.

On the examples I think I used tidyterra::scale_fill_*. These scales differs of the default ggplot2 scales on an option, na.value, that have been set to NA. This prevents NAs from being plotted, but still can be manipulated. Hope this reprex provides clarity:

library(tidyterra)
#> ── Attaching packages ─────────────────────────────────────── tidyterra 0.2.0 ──
#> 
#> Suppress this startup message by setting Sys.setenv(tidyterra.quiet = TRUE)
#> ✔ tibble 3.1.6     ✔ dplyr  1.0.7
#> ✔ tidyr  1.1.4
library(ggplot2)
library(terra)
#> terra 1.5.34
#> 
#> Attaching package: 'terra'
#> The following objec…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by dieghernan
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dieghernan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
📊 ggplot2 Issues related with the implementation of ggplot2 functionalities ❔ q&a Questions on the usage of tidyterra
2 participants
Converted from issue

This discussion was converted from issue #33 on September 21, 2022 07:11.