Learn R Programming

messy (version 0.1.0)

make_missing: 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)

Value

a dataframe the same size as the input data.

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.

Examples

Run this code
make_missing(mtcars)

Run the code above in your browser using DataLab