miss_at_random: Function constructor for injecting independent...

View source: R/missingness_utils.R

miss_at_randomR Documentation

Function constructor for injecting independent missing-at-random NAs to columns

Description

Function constructor for injecting independent missing-at-random NAs to columns

Usage

miss_at_random(p, nvars)

Arguments

p

numeric(1). Proportion of observations to change to missing

nvars

numeric(1). Number of columns this behavior should be applied to.

Value

a function suitable for use in missingness recipe, which when given .df, the data will return an N x nvars logical matrix.


Roche/respectables documentation built on Oct. 2, 2024, 8:57 p.m.