| validate_data {One4All} | R Documentation | 
Validate data based on specified rules
Description
Validate data based on specified rules
Usage
validate_data(
  files_data,
  data_names = NULL,
  file_rules = NULL,
  zip_data = NULL
)
Arguments
| files_data | A list of file paths for the datasets to be validated. | 
| data_names | (Optional) A character vector of names for the datasets. If not provided, names will be extracted from the file paths. | 
| file_rules | A file path for the rules file, either in .csv or .xlsx format. | 
| zip_data | A file path to a zip folder for validating unstructured data. | 
Value
A list containing the following elements: - data_formatted: A list of data frames with the validated data. - data_names: A character vector of dataset names. - report: A list of validation report objects for each dataset. - results: A list of validation result data frames for each dataset. - rules: A list of validator objects for each dataset. - status: A character string indicating the overall validation status ("success" or "error"). - issues: A logical vector indicating if there are any issues in the validation results. - message: A data.table containing information about any issues encountered.
Examples
# Validate data with specified rules
data("valid_example")
data("invalid_example")
data("test_rules")
result_valid <- validate_data(files_data = valid_example,
                        data_names = c("methodology", "particles", "samples"),
                        file_rules = test_rules)
                       
result_invalid <- validate_data(files_data = invalid_example,
                        data_names = c("methodology", "particles", "samples"),
                        file_rules = test_rules)