Description Usage Arguments Value Examples
View source: R/gen_gold_standard.R
add_random_error
adds a column of error flags (between 0 and 1)
to a data frame based on the prob
.
1 | add_random_error(dataset, error_name, prob = c(0.95, 0.05))
|
dataset |
A data frame of the dataset. |
error_name |
A string of the name and type of the error in the form of
'error name_error type'. The error name should be one of the variable name
in the |
prob |
A vector of two numerical probablities, where the first one is the probablity of being 0 and the second one is the probablity of being 1. |
A data frame of the dataset
with an additional column of binary encoded
error.
1 2 | adult_with_flag <- add_random_error(adult[1:100,], prob = c(0.97, 0.03), "age_missing")
adult_with_flag <- add_random_error(adult_with_flag, prob = c(0.65, 0.35), "education_typo")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.