expand_na: Add new variables that indicate if a value is "missing" or...

View source: R/expand_na.R

expand_naR Documentation

Add new variables that indicate if a value is "missing" or "not missing" for original variables that contain NA

Description

Add new variables that indicate if a value is "missing" or "not missing" for original variables that contain NA

Usage

expand_na(
  data,
  types = c("chr", "dbl", "fct", "lgl", "int", "ord"),
  skip_vars = NULL
)

Arguments

data

A data frame

types

A vector of variables types to expand

skip_vars

A character vector of variables that shouldn't be expanded

Value

An augmented data frame with the original variables and new variables that contain the missingness patterns of variables with NA

Examples


expand_na(data = example_na, type = c("dbl", "int"))


tidysynthesis documentation built on March 17, 2026, 1:06 a.m.