Skip to contents

make missing data

Super class

charlatan::BareProvider -> MissingDataProvider

Methods

Inherited methods


Method make_missing()

make missing data

Usage

MissingDataProvider$make_missing(x)

Arguments

x

a vector of characters, numeric, integers, logicals, etc

Details

This method picks a random number (N) of slots in the input vector x (up to length(x)). Then picks N random positions and replaces them with NA matching the input class.


Method clone()

The objects of this class are cloneable with this method.

Usage

MissingDataProvider$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

z <- MissingDataProvider$new()
z$make_missing(x = letters)
#>  [1] NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  "s"
#> [20] "t" NA  NA  NA  NA  NA  "z"