njtierney/naniar

add white lines to clearly separate the missing values in `geom_missing_point`

Open

#30 opened on 2016年12月24日

GitHub で見る
 (5 comments) (2 reactions) (0 assignees)R (557 stars) (43 forks)batch import
enhancementhelp wantedvisualisation

説明

For example:

library(naniar)
library(ggplot2)
# method to draw new white band
y_white_band <- min(airquality$Solar.R, 
                    na.rm = TRUE) - 0.95 * min(airquality$Solar.R, 
                                               na.rm = TRUE)

x_white_band <- min(airquality$Ozone, 
                    na.rm = TRUE) - 0.95 * min(airquality$Solar.R, 
                                               na.rm = TRUE)

ggplot(data = airquality,
       aes(x = Ozone,
           y = Solar.R)) +
  geom_missing_point() + 
  # geom_hline(yintercept = -3,
  geom_hline(yintercept = y_white_band,
             size = 2,
             colour = "white") +
  # geom_vline(xintercept = -3,
  geom_vline(xintercept = x_white_band,
             size = 2,
             colour = "white")

As opposed to

ggplot(data = airquality,
       aes(x = Ozone,
           y = Solar.R)) +
  geom_missing_point() 

コントリビューターガイド

add white lines to clearly separate the missing values in `geom_missing_point` · njtierney/naniar#30 | Good First Issue