Skip to contents

make missing data

Super class

charlatan::BaseProvider -> 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] "a" "b" NA  "d" NA  NA  "g" NA  "i" "j" NA  "l" NA  NA  NA  "p" "q" NA  "s"
#> [20] "t" "u" "v" NA  "x" "y" "z"