make_missing: Make missing

View source: R/make_missing.R

make_missingR Documentation

Make missing

Description

Randomly make values missing in all data columns, or a subset of columns

Usage

make_missing(data, cols = NULL, messiness = 0.1, missing = NA)

Arguments

data

input dataframe

cols

set of columns to apply transformation to. If NULL will apply to all columns. Default NULL.

messiness

Percentage of values to change. Must be between 0 and 1. Default 0.1.

missing

A single value, vector, or list of what the missing values will be replaced with. If length is greater than 1, values will be replaced randomly. Default NA.

Value

a dataframe the same size as the input data.

Examples

make_missing(mtcars)

messy documentation built on April 3, 2025, 6:16 p.m.