visdat
visdat copied to clipboard
colourblind palette shows false NA values
When using palette = "cb_safe"
in vis_dat
, it shows missing values where there are none
library(visdat)
library(naniar)
library(tidyverse)
#> Loading tidyverse: ggplot2
#> Loading tidyverse: tibble
#> Loading tidyverse: tidyr
#> Loading tidyverse: readr
#> Loading tidyverse: purrr
#> Loading tidyverse: dplyr
#> Conflicts with tidy packages ----------------------------------------------
#> filter(): dplyr, stats
#> lag(): dplyr, stats
# shows missing values where there are none
pedestrian %>%
filter(month=="January",
year==2016) %>%
vis_dat(palette = "cb_safe") +
theme(aspect.ratio=1)
But if you use regular vis_dat
, then there are no missing values shown.
# missing values not shown
pedestrian %>%
filter(month=="January",
year==2016) %>%
vis_dat() +
theme(aspect.ratio=1)
Need to dig into what happens here.
Thanks @dicook for pointing this out!
Consider using the colorspace
R package to resolve this issue