Learn R Programming

naniar (version 0.6.1)

unbinders: Unbind (remove) shadow from data, and vice versa

Description

Remove the shadow variables (which end in _NA) from the data, or vice versa. This will also remove the nabular class from the data.

Usage

unbind_shadow(data)

unbind_data(data)

Value

data.frame without shadow columns if using unbind_shadow(), or without the original data, if using unbind_data().

Arguments

data

data.frame containing shadow columns (created by bind_shadow())

Examples

Run this code

# bind shadow columns
aq_sh <- bind_shadow(airquality)

# print data
aq_sh

# remove shadow columns
unbind_shadow(aq_sh)

# remove data
unbind_data(aq_sh)

# errors when you don't use data with shadows
if (FALSE) {
 unbind_data(airquality)
 unbind_shadow(airquality)
}

Run the code above in your browser using DataLab