powered by
allows adding NA values to a data frame, selecting the columns and the proportion of desired NAs.
insert_na(.dataset, columns, .p = 0.01, seed = 123)
data frame.
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.
value between 0 and 1, indicating the proportion of NA values that will be added.
random number seed.
the original data frame, but with the NA values added in the indicated columns.
# NOT RUN { insert_na(.dataset = iris, columns = c("Sepal.Length","Petal.Length"), .p = 0.25) # }
Run the code above in your browser using DataLab