messy: Simulate missing data

Description Usage Arguments Value Examples

View source: R/messy.R

Description

Insert NA or another replacement value for some proportion of specified columns to simulate missing data.

Usage

1
messy(data, prop = 0, ..., replace = NA)

Arguments

data

the tbl

prop

the proportion of data to mess up

...

the columns to mess up (as a vector of column names or numbers)

replace

the replacement value (defaults to NA)

Value

the messed up table

Examples

1
2
messy(iris, 0.1, "Species", replace = "NO SPECIES")
messy(iris, 0.5, 1:4)

faux documentation built on Sept. 14, 2021, 1:08 a.m.