as_shadow: Create shadows

View source: R/shadows.R

as_shadowR Documentation

Create shadows

Description

Return a tibble in shadow matrix form, where the variables are the same but have a suffix _NA attached to distinguish them.

Usage

as_shadow(data, ...)

Arguments

data

dataframe

...

selected variables to use

Details

Representing missing data structure is achieved using the shadow matrix, introduced in Swayne and Buja. The shadow matrix is the same dimension as the data, and consists of binary indicators of missingness of data values, where missing is represented as "NA", and not missing is represented as "!NA". Although these may be represented as 1 and 0, respectively.

Value

appended shadow with column names

Examples


as_shadow(airquality)

njtierney/naniar documentation built on March 19, 2024, 9:48 p.m.