Create rules from the codebook using validate::validator()
Source:R/create_rules.R
, R/factcurator_wrappers.R
create_rules.Rd
This functions reads in codebooks_all_db.csv and generates rules from the information provided in this main codebook
Arguments
- 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"
Details
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.
See also
Other validation functions:
confront_data()
,
find_col_info()
,
validate_colnames()