create_rules | R Documentation |
This functions reads in codebooks_all_db.csv and generates rules from the information provided in this main codebook
create_rules(df_type, db_folder, blends = FALSE, crop_types)
create.rules(df_type, db_folder)
df_type |
A string "trial_data" or "trials_metadata" denoting the type of validation rules to generate |
db_folder |
A string path to the database controlled vocabulary folder |
blends |
A logical denoting whether there are blends stored in the variety column in df_type = "trial_data" |
crop_types |
A vector containing the crop_types. This is used to select the appropriate traits if codebook_name == "trial_data" |
Note: grepl returns FALSE if the tested object is NA, so NAs are not correctly detected in grepl checks. Currently, the validator package does not accept str_detect. As a workaround, for date fields, an extra check for NAs is implemented.
Other validation functions:
confront_data()
,
find_col_info()
,
validate_colnames()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.