Skip to contents

TBD

Usage

fct_check_data(.ad, .cs, .init)

Arguments

.ad

Activity Data input table for the shiny app (AD_lu_transitions)

.cs

Carbon Stock input table for the shiny app (c_stocks)

.init

initial list of coded variables for carbon pools and REDD+ activity to check the imported data against.

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)

cs <- read_xlsx(
  path = system.file("extdata/example1.xlsx", package = "mocaredd"),
   sheet = "c_stocks",
   na = "NA"
   )
ad <- read_xlsx(
  path = system.file("extdata/example1.xlsx", package = "mocaredd"),
  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)
#>   pass_trans_id pass_c_id pass_pool pass_acti pass_lu_no
#> 1          TRUE      TRUE      TRUE      TRUE       TRUE