njtierney/naniar

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

オープン

#30 opened on 2016/12/24

 (5 件のコメント) (2 件のリアクション) (0 人の担当者)R (56 件のフォーク)batch import
enhancementhelp wantedvisualisation

Repository metrics

Stars
 (674 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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() 

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