Check that the app's the input data has matching land uses and correct carbon pools and associated factors.
Source:R/fct_check_data.R
fct_check_data.Rd
TBD
Value
A dataframe with TRUE or FALSE for each flag, (TRUE meaning the flag is raised and an issue was detected).
Examples
library(mocaredd)
library(readxl)
path <- system.file("extdata/example1-4pools.xlsx", package = "mocaredd")
cs <- read_xlsx(path = path, sheet = "c_stocks", na = "NA")
ad <- read_xlsx(path = path, sheet = "AD_lu_transitions", na = "NA")
.init <- init <- list(
c_pools = c("AGB", "BGB", "RS", "DW", "LI", "SOC", "ALL", "DG_ratio"),
redd_acti = c("DF", "DG", "EN", "EN_AF", "EN_RE")
)
fct_check_data(.ad = ad, .cs = cs, .init = init)
#> Warning: Unknown or uninitialised column: `c_pool`.
#> Warning: Unknown or uninitialised column: `redd_activity`.
#> Warning: Unknown or uninitialised column: `lu_initial_id`.
#> Warning: Unknown or uninitialised column: `lu_final_id`.
#> Warning: Unknown or uninitialised column: `lu_id`.
#> pass_trans_id pass_c_id pass_pool pass_acti pass_lu_no
#> 1 TRUE TRUE TRUE TRUE TRUE