Validate tables against the model
(list) A dataset of the structure returned by
(character) Path to a directory containing ecocomDP tables as files.
File names - File names are the ecocomDP table names.
Table presence - Required tables are present.
Column names - Column names of all tables match the model.
Column presence - Required columns are present.
Column classes - Column classes match the model specification.
Datetime format - Date and time formats follow the model specification.
Primary keys - Primary keys of tables are unique.
Composite keys - Composite keys (unique constraints) of each table are unique.
Referential integrity - Foreign keys have a corresponding primary key.
Coordinate format - Values are in decimal degree format.
Coordinate range - Values are within -90 to 90 and -180 to 180.
Elevation - Values are less than Mount Everest (8848 m) and greater than Mariana Trench (-10984 m).
Variable mapping - variable_name is in table_name.
Mapped_id - values in mapped_id are valid URIs
(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.
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.