Generate a draft validation plan in a new .R or .Rmd file using an input data table. Using this workflow, the data table will be scanned to learn about its column data and a set of starter validation steps (constituting a validation plan) will be written. It's best to use a data extract that contains at least 1000 rows and is relatively free of spurious data.
Once in the file, it's possible to tweak the validation steps to better fit
the expectations to the particular domain. While column inference is used to
generate reasonable validation plans, it is difficult to infer the acceptable
values without domain expertise. However, using
get you started on floor 10 of tackling data quality issues and is in any
case better than starting with an empty code editor view.
draft_validation( tbl, tbl_name = NULL, file_name = tbl_name, path = NULL, lang = NULL, output_type = c("R", "Rmd"), add_comments = TRUE, overwrite = FALSE, quiet = FALSE )
The input table. This can be a data frame, tibble, a
A optional name to assign to the input table object. If no
value is provided, a name will be generated based on whatever information
is available. This table name will be displayed in the header area of the
agent report generated by printing the agent or calling
An optional name for the .R or .Rmd file. This should be a
name without an extension. By default, this is taken from the
A path can be specified here if there shouldn't be an attempt to place the generated file in the working directory.
The language to use when creating comments for the automatically-
generated validation steps. By default,
An option for choosing what type of output should be
generated. By default, this is an .R script (
Should there be comments that explain the features of the
validation plan in the generated document? By default, this is
Should a file of the same name be overwritten? By default,
Should the function not inform when the file is written? By
default this is
TRUE if the file has been written.