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

check_data_vegetation(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_vegetation(path_to_fieldmapdb)
#> # A tibble: 13 × 6
#>    plot_id subplot_id period aberrant_field anomaly aberrant_value
#>      <int>      <int>  <int> <chr>          <chr>   <chr>         
#>  1    2006          1      1 moss_cover_id  missing NA            
#>  2    2006          1      1 herb_cover_id  missing NA            
#>  3    2006          1      1 shrub_cover_id missing NA            
#>  4    2006          1      1 tree_cover_id  missing NA            
#>  5     204          1      2 date           missing NA            
#>  6     204          1      2 fieldteam      missing NA            
#>  7     204          1      2 moss_cover_id  missing NA            
#>  8     204          1      2 herb_cover_id  missing NA            
#>  9     204          1      2 shrub_cover_id missing NA            
#> 10     204          1      2 tree_cover_id  missing NA            
#> 11    1005          1      2 moss_cover_id  missing NA            
#> 12    1005          1      2 shrub_cover_id missing NA            
#> 13    1005          1      2 tree_cover_id  missing NA            
check_data_vegetation(path_to_fieldmapdb, forest_reserve = "Everzwijnbad")
#> # A tibble: 0 × 6
#> # ℹ 6 variables: plot_id <int>, subplot_id <int>, period <int>,
#> #   aberrant_field <chr>, anomaly <chr>, aberrant_value <chr>