validate_data {ecocomDP}R Documentation

Validate tables against the model

Description

Validate tables against the model

Usage

validate_data(dataset = NULL, path = NULL)

Arguments

dataset

(list) A dataset of the structure returned by read_data().

path

(character) Path to a directory containing ecocomDP tables as files.

Details

Validation checks:

Value

(list) If any checks fail, then a list of validation issues are returned along with a warning. If no issues are found then NULL is returned.

Note

This function is used by ecocomDP creators (to ensure what has been created is valid), maintainers (to improve the quality of archived ecocomDP datasets), and users (to ensure the data being used is free of error).

Examples

## Not run: 
# Write a set of ecocomDP tables to file for validation
mydir <- paste0(tempdir(), "/dataset")
dir.create(mydir)
write_tables(
  path = mydir,
  observation = ants_L1$tables$observation, 
  observation_ancillary = ants_L1$tables$observation_ancillary,
  location = ants_L1$tables$location,
  location_ancillary = ants_L1$tables$location_ancillary,
  taxon = ants_L1$tables$taxon,
  taxon_ancillary = ants_L1$tables$taxon_ancillary,
  dataset_summary = ants_L1$tables$dataset_summary,
  variable_mapping = ants_L1$tables$variable_mapping)

# Validate
validate_data(path = mydir)

# Clean up
unlink(mydir, recursive = TRUE)

## End(Not run)


[Package ecocomDP version 1.3.1 Index]