Plotdetails
from Fieldmap
database for inconsistenciesR/check_data_plotdetails.R
check_data_plotdetails.Rd
This function retrieves the important fields of table Plotdetails
(of all periods) from the given database and
checks for missing data or wrong input.
check_data_plotdetails(database, forest_reserve = "all")
Dataframe with inconsistent data with ID's and additional columns
aberrant_field
(which column is wrong) and anomaly
(what is wrong with
the input)
library(forrescalc)
# (add path to your own fieldmap database here)
path_to_fieldmapdb <-
system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")
check_data_plotdetails(path_to_fieldmapdb)
#> # A tibble: 9 × 5
#> plot_id period aberrant_field anomaly aberrant_value
#> <int> <dbl> <chr> <chr> <chr>
#> 1 11000 1 length_core_area_m missing NA
#> 2 11000 1 width_core_area_m missing NA
#> 3 11000 2 length_core_area_m missing NA
#> 4 11000 2 width_core_area_m missing NA
#> 5 11000 3 length_core_area_m missing NA
#> 6 11000 3 width_core_area_m missing NA
#> 7 11000 0 fieldteam missing NA
#> 8 11000 0 length_core_area_m missing NA
#> 9 11000 0 width_core_area_m missing NA
check_data_plotdetails(path_to_fieldmapdb, forest_reserve = "Everzwijnbad")
#> # A tibble: 0 × 5
#> # ℹ 5 variables: plot_id <int>, period <int>, aberrant_field <chr>,
#> # anomaly <lgl>, aberrant_value <chr>