insert_na: Add NA values to a dataframe

Description Usage Arguments Value Examples

View source: R/insert_na.R

Description

allows adding NA values to a data frame, selecting the columns and the proportion of desired NAs.

Usage

1
insert_na(.dataset, columns, .p = 0.01, seed = 123)

Arguments

.dataset

data frame.

columns

vector that indicates the name of the columns where the NA values will be added, in the format: c("X1", "X2") for variables X1, X2.

.p

value between 0 and 1, indicating the proportion of NA values that will be added.

seed

random number seed.

Value

the original data frame, but with the NA values added in the indicated columns.

Examples

1
insert_na(.dataset = iris, columns = c("Sepal.Length","Petal.Length"), .p = 0.25)

sknifedatar documentation built on June 1, 2021, 9:08 a.m.