check_terms.RdCheck the terms used in a dataset. A data.frame is returned that lists: unknown variables; required variables that are missing; character values that are not accepted; numeric variables that are out of the expected range; and variables with the wrong data type.
check_terms(records=NULL, metadata=NULL, longrecs=NULL, wth=NULL, soil=NULL, group="", check="all")data.frame with observations in "wide" format
data.frame with metadata
data.frame with "long" format observations, for when there are multiple observations in time or depth for a single observational unit
data.frame with weather data
data.frame with soil data
character. Optional group name
character. "none" to do no checking; "nogeo" to not check coordinates. "all" and all other values to do all checks
data.frame
records <- utils::read.csv(system.file("ex/records.csv", package = "carobiner"))
meta <- utils::read.csv(system.file("ex/metadata.csv", package = "carobiner"))
x <- check_terms(records, meta)
#> Warning: incomplete final line found on 'https://api.github.com/repos/controvoc/terminag/commits/main'
#> Cached as: /home/runner/.local/share/.carob/gadm/gadm36_adm0_r1_pk.rds
x
#> check
#> 1 unknown variables
#> 2 bad datatype
#> 3 missing variables
#> 4 bad datatype
#> 5 out of bounds
#> 6 NA detected
#> msg
#> 1 crops, countries
#> 2 version (integer, not character)
#> 3 harvest_date
#> 4 trial_id (integer, not character), plot_id (integer, not character)
#> 5 grain_P (15, 49), residue_P (1, 26)
#> 6 yield