This function retrieves the important fields of table Trees (of all periods) from the given database and checks for missing data or wrong input.

check_data_trees(database, forest_reserve = "all")

Arguments

database

name of Fieldmap/Access database (with specific Fieldmap structure) including path

forest_reserve

name of forest reserve for which the records in the database should be checked (defaults to "all")

Value

Dataframe with inconsistent data with ID's and additional columns aberrant_field (which column is wrong) and anomaly (what is wrong with the input)

Examples

library(forrescalc)
# (add path to your own fieldmap database here)
path_to_fieldmapdb <-
  system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")
check_data_trees(path_to_fieldmapdb)
#> # A tibble: 60 × 6
#>    plot_id tree_measure_id period aberrant_field anomaly          aberrant_value
#>      <int> <chr>            <dbl> <chr>          <chr>            <chr>         
#>  1     204 1                    1 iufro_hght     not in lookupli… 0             
#>  2     204 1                    1 iufro_vital    not in lookupli… 0             
#>  3     204 1                    1 iufro_socia    not in lookupli… 0             
#>  4     204 1540                 1 iufro_hght     not in lookupli… 0             
#>  5     204 1540                 1 iufro_vital    not in lookupli… 0             
#>  6     204 1540                 1 iufro_socia    not in lookupli… 0             
#>  7     204 2                    1 iufro_hght     not in lookupli… 0             
#>  8     204 2                    1 iufro_vital    not in lookupli… 0             
#>  9     204 2                    1 iufro_socia    not in lookupli… 0             
#> 10    1005 23                   1 iufro_hght     not in lookupli… 0             
#> # ℹ 50 more rows
check_data_trees(path_to_fieldmapdb, forest_reserve = "Everzwijnbad")
#> # A tibble: 0 × 6
#> # ℹ 6 variables: plot_id <int>, tree_measure_id <chr>, period <int>,
#> #   aberrant_field <chr>, anomaly <chr>, aberrant_value <lgl>