check_ecotox_build: Check the locally build database for validity

View source: R/database_access.r

check_ecotox_buildR Documentation

Check the locally build database for validity

Description

[Stable] Performs some simple tests to check whether the locally built database is not corrupted.

Usage

check_ecotox_build(path = get_ecotox_path(), version, ...)

Arguments

path

A character string with the path to the location of the local database (default is get_ecotox_path()).

version

A character string referring to the release version of the database you wish to locate. It should have the same format as the date in the EPA download link, which is month, day, year, separated by underscores ("%m_%d_%Y"). When missing, the most recent available copy is selected automatically.

...

Arguments that are passed to dbConnect() method or dbDisconnect() method.

Details

For now this function tests if all expected tables are present in the locally built database. Note that in later release of the database some tables were added. Therefore for older builds this function might return FALSE whereas it is actually just fine (just out-dated).

Furthermore, this function tests if all tables contain one or more records. Obviously, this is no guarantee that the database is valid, but it is a start.

More tests may be added in future releases.

Value

Returns an indicative logical value whether the database is not corrupted. TRUE indicates the database is most likely OK. FALSE indicates that something might be wrong. Additional messages (when FALSE) are included as attributes containing hints on the outcoming of the tests. See also the 'details' section.

Author(s)

Pepijn de Vries

Examples

## Not run: 
check_ecotox_build()

## End(Not run)

ECOTOXr documentation built on Sept. 20, 2024, 5:06 p.m.