Learn R Programming

naniar (version 0.0.3.9901)

bind_shadow: Column bind a shadow dataframe to original data

Description

Binding a shadow dataframe to a regular dataframe helps visualise and work with missing data

Usage

bind_shadow(data)

Arguments

data
a dataframe

Value

dataframe with an extra appended layer of data.

Examples

Run this code

bind_shadow(airquality)

# explore missing data visually
library(ggplot2)

# using the bounded shadow

ggplot(data = bind_shadow(airquality),
       aes(x = Ozone)) +
       geom_histogram() +
       facet_wrap(~Solar.R_NA,
       ncol = 1)

# using the is_na function

ggplot(data = airquality,
       aes(x = Ozone)) +
  geom_histogram() +
  facet_wrap(~is_na(Solar.R),
             ncol = 1)

Run the code above in your browser using DataLab