From c661dcaafa53868b9d78852079791918af5d2422 Mon Sep 17 00:00:00 2001 From: gaelso Date: Thu, 14 Nov 2024 13:45:18 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20openfori?= =?UTF-8?q?s/mocaredd@b27ecdc740c8da1616e3bd5d4c3929984e76aafa=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgdown.yml | 2 +- reference/fct_check_data2.html | 10 +++++++--- search.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgdown.yml b/pkgdown.yml index 8cea36c..d56519a 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: app-build: app-build.html app-desc: app-desc.html -last_built: 2024-11-14T11:38Z +last_built: 2024-11-14T13:44Z urls: reference: https://openforis.github.io/mocaredd/reference article: https://openforis.github.io/mocaredd/articles diff --git a/reference/fct_check_data2.html b/reference/fct_check_data2.html index 8d1cc36..c5ab507 100644 --- a/reference/fct_check_data2.html +++ b/reference/fct_check_data2.html @@ -115,10 +115,14 @@

Examples cat_racti = c("DF", "DG", "EN", "EN_AF", "EN_RE"), cat_ptype = c("REF", "REF[0-9]", "MON", "MON[0-9]"), cat_pdf = c("normal", "beta"), - col_usr = c("trunc_pdf", "n_iter", "ran_seed", "c_unit", "c_fraction", "dg_pool", "dg_expool", "ad_annual", "conf_level"), + col_usr = c("trunc_pdf", "n_iter", "ran_seed", "c_unit", "c_fraction", "dg_pool", + "dg_expool", "ad_annual", "conf_level"), col_time = c("period_no", "year_start", "year_end", "period_type"), - col_ad = c("trans_no", "trans_id", "trans_period", "redd_activity", "lu_initial_id", "lu_initial", "lu_final_id", "lu_final", "trans_area", "trans_se", "trans_pdf", "trans_pdf_a", "trans_pdf_b", "trans_pdf_c"), - col_cs = c("c_no", "c_id", "c_period", "lu_id", "lu_name", "c_pool", "c_value", "c_se", "c_pdf", "c_pdf_a", "c_pdf_b", "c_pdf_c") + col_ad = c("trans_no", "trans_id", "trans_period", "redd_activity", "lu_initial_id", + "lu_initial", "lu_final_id", "lu_final", "trans_area", "trans_se", + "trans_pdf", "trans_pdf_a", "trans_pdf_b", "trans_pdf_c"), + col_cs = c("c_no", "c_id", "c_period", "lu_id", "lu_name", "c_pool", "c_value", + "c_se", "c_pdf", "c_pdf_a", "c_pdf_b", "c_pdf_c") ) app_checklist$cat_cpools_all <- c(app_checklist$cat_cpools, "RS", "DG_ratio") diff --git a/search.json b/search.json index 64e94f9..9124d3a 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://openforis.github.io/mocaredd/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 mocaredd authors, Open Foris Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"inital-setup","dir":"Articles","previous_headings":"","what":"Inital setup:","title":"mocaredd - package creation steps","text":"Create Github repository. Create R project Github (See https://happygitwithr.com/ linking Github repos Rstudio). usethis::create_package(\"PATH/mocaredd\") PATH path project folder set project creation. usethis::use_pkgdown() usethis::use_vignette(\"app-generation\", title = \"MCredd - package creation steps\") usethis::use_testthat() usethis::use_mit_license() usethis::use_github_action() advanced workflow: usethis::use_github_action(\"check-full\") usethis::create_from_github(\"openforis/mocaredd\", fork = TRUE, destdir = \"/Users/gaelsola/Github-repos\")","code":""},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"barebone-app","dir":"Articles","previous_headings":"","what":"Barebone app","title":"mocaredd - package creation steps","text":"Add dependencies DESCRIPTION:","code":"usethis::use_package(\"dplyr\")"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"run-all-the-time","dir":"Articles","previous_headings":"","what":"Run all the time:","title":"mocaredd - package creation steps","text":"","code":"devtools::document() devtools::load_all() shiny_run_mocaredd() devtools::install() library(mocaredd) shiny_run_mocaredd()"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"checks","dir":"Articles","previous_headings":"","what":"Checks","title":"mocaredd - package creation steps","text":"","code":"devtools::check() ## Run one time # usethis::use_testthat() usethis::use_r(\"fct_check_data\") usethis::use_test(\"fct_check_data\") usethis::use_test(\"fct_combine_mcs_P\")"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"build-pkgdown-website","dir":"Articles","previous_headings":"","what":"Build pkgdown website","title":"mocaredd - package creation steps","text":"","code":"#pkgdown::build_site() usethis::use_pkgdown_github_pages()"},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"https://openforis.github.io/mocaredd/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Gael Sola. Author, maintainer. Javier Garcia Perez. Author. Jimena Saucedo Miranda. Author. Lauri Vesa. Author.","code":""},{"path":"https://openforis.github.io/mocaredd/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sola G, Garcia Perez J, Saucedo Miranda J, Vesa L (2024). mocaredd: Monte Carlo Simulation REDD+ uncertainty analysis. R package version 0.0.0.9000, https://openforis.github.io/mocaredd/, https://github.com/openforis/mocaredd.","code":"@Manual{, title = {mocaredd: Monte Carlo Simulation for REDD+ uncertainty analysis}, author = {Gael Sola and Javier {Garcia Perez} and Jimena {Saucedo Miranda} and Lauri Vesa}, year = {2024}, note = {R package version 0.0.0.9000, https://openforis.github.io/mocaredd/}, url = {https://github.com/openforis/mocaredd}, }"},{"path":"https://openforis.github.io/mocaredd/index.html","id":"mocaredd-monte-carlo-simulations-for-redd-uncertainty-analysis","dir":"","previous_headings":"","what":"Monte Carlo Simulation for REDD+ uncertainty analysis","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"Contains functions shiny app (1) setting , (2) running Monte Carlo Simulations (3) producing improved estimates confidence intervals around greenhouse gas emissions emission reductions forestry sector. apps takes input XLSX file following specific template meant harmonize reporting areas land use transitions associated carbon stocks. provides simulations, medians, percentage uncertainties confidence intervals various stages aggregation emissions related land use transitions REDD+ activities emission reductions reference monitoring periods.  ","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"workflow","dir":"","previous_headings":"","what":"Workflow","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"Input XSLX filled following provided template. (Note v2.0, accept separated CSV files, format tbd). Checks run ensure entity codes unique matching tables. Simulations produced results can seen forest plots, simulations densities comparison simulations arithmetic means final emission reductions. Sensitivity analysis shows impact AE vs EF, REDD+ activities, time periods.","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"calculation-steps","dir":"","previous_headings":"","what":"Calculation steps","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"template","dir":"","previous_headings":"","what":"Template","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"(ADD Link template github ) template includes 4 tabs:","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"user-inputs-user_inputs","dir":"","previous_headings":"Template","what":"User inputs (user_inputs)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"help offering great flexibility minimum number parameters. trunc_pdf: use truncated PDF avoid negative simulated values illogical (ex. areas.). (Note v2.0, currently works normal distributions). n_iter: number iterations. standards require 10,000 simulations. ran_seed: rand seed simulation. note specified, first run sets random seed reports reproducing results. c_unit: AGB abd BGB, unit dry matter (DM) carbon (C)? dg_pool: degradation ratio intact forest Cstock, list pools separated coma ratio applies. dg_expool: (experimental) Pools excluded degradation process (may redundant). ad_annual: Activity Data reported annual sum time period considered? (TRUE FALSE). conf_level: Confidence level (1 - alpha) uncertainty calculations.","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"time-periods-time_periods","dir":"","previous_headings":"Template","what":"Time periods (time_periods)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"land-use-transitions-ad_lu_transitions","dir":"","previous_headings":"Template","what":"land use transitions (AD_lu_transitions)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"carbon-stocks-c_stocks","dir":"","previous_headings":"Template","what":"Carbon stocks (c_stocks)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"road-map-of-future-developements","dir":"","previous_headings":"","what":"Road map of future developements","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"load input csv Include various soil organic carbon method Include removals","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"Monte Carlo simulations package functions generate table one row = one simulation. fct_calc_res() takes simulation table output simulated variable's median confidence interval selected category (land use transition, REDD+ activity time period).","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"","code":"fct_calc_res(.data, .id, .sim, .ci_alpha)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":".data data frame containing simulation aggregated results .id name ID column data frame .sim name column containing simulated values .ci_alpha alpha value confidence interval confidence level = 1 - alpha.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"tibble simulation results per category ID column: estimated mean, percentage uncertainty, margin error, lower upper bound confidence interval.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"","code":"## TBD"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"","code":"fct_check_data(.ad, .cs, .init)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":".ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .init initial list coded variables carbon pools REDD+ activity check imported data .","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"dataframe TRUE FALSE flag, (TRUE meaning flag raised issue detected).","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"","code":"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"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's input data meet the template criteria. — fct_check_data2","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"Tests 6 types conformity app template avoid code break analysis: (1) column names, (2) tables' size, (3) data types, (4) categories names, (5) unique IDs (6) matching key variables tables.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"","code":"fct_check_data2(.usr, .time, .ad, .cs, .checklist)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":".usr User inputs' table shiny app (user_inputs) .time 'time' table tool input file (see template) .ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .checklist list coded category variables used template.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"dataframe TRUE FALSE (TRUE check passes), broad error locations FALSE.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"","code":"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\" ) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) time <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"time_periods\", na = \"NA\" ) app_checklist <- list( xlsx_tabs = c(\"user_inputs\", \"time_periods\", \"AD_lu_transitions\", \"c_stocks\"), cat_cunits = c(\"DM\", \"C\"), cat_cpools = c(\"AGB\", \"BGB\", \"DW\", \"LI\", \"SOC\", \"ALL\"), cat_racti = c(\"DF\", \"DG\", \"EN\", \"EN_AF\", \"EN_RE\"), cat_ptype = c(\"REF\", \"REF[0-9]\", \"MON\", \"MON[0-9]\"), cat_pdf = c(\"normal\", \"beta\"), col_usr = c(\"trunc_pdf\", \"n_iter\", \"ran_seed\", \"c_unit\", \"c_fraction\", \"dg_pool\", \"dg_expool\", \"ad_annual\", \"conf_level\"), col_time = c(\"period_no\", \"year_start\", \"year_end\", \"period_type\"), col_ad = c(\"trans_no\", \"trans_id\", \"trans_period\", \"redd_activity\", \"lu_initial_id\", \"lu_initial\", \"lu_final_id\", \"lu_final\", \"trans_area\", \"trans_se\", \"trans_pdf\", \"trans_pdf_a\", \"trans_pdf_b\", \"trans_pdf_c\"), col_cs = c(\"c_no\", \"c_id\", \"c_period\", \"lu_id\", \"lu_name\", \"c_pool\", \"c_value\", \"c_se\", \"c_pdf\", \"c_pdf_a\", \"c_pdf_b\", \"c_pdf_c\") ) app_checklist$cat_cpools_all <- c(app_checklist$cat_cpools, \"RS\", \"DG_ratio\") fct_check_data2(.ad = ad, .cs = cs, .usr = usr, .time = time, .checklist = app_checklist) #> $cols_ok #> [1] TRUE #> #> $size_ok #> [1] TRUE #> #> $datatypes_ok #> [1] TRUE #> #> $cats_ok #> [1] TRUE #> #> $ids_ok #> [1] TRUE #> #> $matches_ok #> [1] TRUE #> #> $all_ok #> [1] TRUE #> #> $pbs #> named list() #>"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":null,"dir":"Reference","previous_headings":"","what":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"expected input carbon stock table tool contains carbon values different carbon pools coded: - AGB aboveground biomass, - BGB RS (Root--Shoot ratio) belowground biomass, - DW deadwood, - LI litter - SOC soil organic carbon. pools can expressed tons Carbon (C) CO2. AGB BGB can also expressed ton dry matter (DM), carbon fraction (CF) also needed.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"","code":"fct_check_pool(.c_lu, .c_unit, .c_fraction)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":".c_lu Subset Carbon Stock input table (c_stock) unique land use .c_unit Unit used report AGB (BGB included), shiny app template user inputs. .c_fraction Value carbon fraction, dry matter reported","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"dataframe TRUE FALSE pool factor app's carbon stock input data given land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"","code":"library(mocaredd) library(readxl) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union cs <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) c_lu <- cs |> filter(lu_id == \"ev_wet_closed\") fct_check_pool(.c_lu = c_lu, .c_unit = \"C\", .c_fraction = NA) #> lu_id lu_name has_AG has_BG has_RS has_DW has_LI has_SO #> 1 ev_wet_closed Closed Wet Evergreen TRUE TRUE FALSE TRUE TRUE TRUE #> has_AL has_CF has_DG #> 1 FALSE FALSE FALSE"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"","code":"fct_combine_mcs_C(.c_sub, .usr)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":".c_sub Subset one land use carbon stock input table shiny app (c_stocks). .usr User inputs' table shiny app (user_inputs). Contains number iterations MCS, carbon fraction needed truncated PDFs used necessary.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"data frame N simulations carbon pool associated factors resulting total carbon stock tCO2/ha.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"","code":"library(dplyr) library(readxl) library(mocaredd) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) cs <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) cs_clean <- cs |> filter(!(is.na(c_value) & is.na(c_pdf_a))) c_sub <- cs_clean |> filter(lu_id == \"ev_wet_closed\") res <- fct_combine_mcs_C(.c_sub = c_sub, .usr = usr) hist(res$C_all) round(median(res$C_all)) #> [1] 453"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"","code":"fct_combine_mcs_E(.ad, .cs, .usr)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":".ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .usr User inputs' table shiny app (user_inputs). Contains number iterations MCS, carbon fraction needed truncated PDFs used necessary.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"list dataframes Monte Carlo simulations input variables, REDD+ activities CO2 emissions removals emission reductions levels.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"","code":"library(readxl) library(dplyr) library(mocaredd) cs <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) ad <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"AD_lu_transitions\", na = \"NA\" ) usr <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) cs_clean <- cs |> filter(!is.na(c_value) | !is.na(c_pdf_a)) res <- fct_combine_mcs_E(.ad = ad, .cs = cs_clean, .usr = usr) #> Random simulations with seed: 93 hist(res$E_sim) round(median(res$E_sim)) #> [1] 75830"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"Depending period defined data annualized , calculate Emission Level reference monitoring period simulation.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"","code":"fct_combine_mcs_P(.data, .time, .period_type, .ad_annual)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":".data data frame containing simulations .time 'time' table tool input file (see template) .period_type \"reference\" \"monitoring\" .ad_annual TRUE FALSE, activity data annualized .","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"tibble simulations final estimate per type period.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"","code":"library(readxl) library(dplyr) library(mocaredd) 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\" ) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) time <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"time_periods\", na = \"NA\" ) ad_clean <- ad |> dplyr::filter(!is.na(trans_area) | !is.na(trans_pdf_a)) cs_clean <- cs |> dplyr::filter(!is.na(c_value) | !is.na(c_pdf_a)) time_clean <- time |> dplyr::mutate(nb_years = year_end - year_start + 1) sim_trans <- fct_combine_mcs_E(.ad = ad_clean, .cs = cs_clean, .usr = usr) #> Random simulations with seed: 93 sim_FREL <- fct_combine_mcs_P( .data = sim_trans, .time = time_clean, .period_type = \"REF\", .ad_annual = usr$ad_annual ) hist(sim_FREL$E_sim) round(median(sim_FREL$E_sim)) #> [1] 4591614"},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"Produce gt table median confidence interval Monte Carlo simulations category level analysis (land use transition, REDD+ activity, time period) forest plot showing median CI together.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"","code":"fct_forestplot( .data, .id, .value, .uperc, .cilower, .ciupper, .id_colname, .conflevel, .filename )"},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":".data data frame containing simulation aggregated results .id name ID column data frame .value name value column data frame (.e median simulations) .uperc name percentage uncertainty simulations .cilower name lower end confidence interval .ciupper name higher end confidence interval .id_colname character text ID column names. goes gt::md() gt::cols_label() .conflevel character text specify confidence level used, ex. \"90%\". .filename path save table NA.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"character value formula calculating total carbon stock specific land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate histogram to show the simulations at any stage. — fct_histogram","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"Takes simulation data fct_combine_mcs_E() fct_combine_mcs_P() aggregated results fct_calc_res() generate histogram showing PDF density, modeled normal distribution, simulations' median confidence interval.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"","code":"fct_histogram(.data, .res, .id, .value, .value_type, ...)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":".data data frame simulated data. Output fct_combine_mcs_E() fct_combine_mcs_P(). .res aggregated results simulation. Output fct_calc_res() .id ID column .data .res inputs. .value simulated values column .data. .value_type \"E\" \"ER\" .data represents emissions emission reductions respectively. ... filter query, passed dplyr::filter().","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"ggplot named list ggplots","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"expected input carbon stock table tool contains carbon values different carbon pools coded: - AGB aboveground biomass, - BGB RS (Root--Shoot ratio) belowground biomass, - DW deadwood, - LI litter - SOC soil organic carbon. pools can expressed tons Carbon (C) CO2. AGB BGB can also expressed ton dry matter (DM), carbon fraction (CF) also needed.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"","code":"fct_make_formula(.c_check, .c_unit)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":".c_check output fct_check_pool() .c_unit \"DM\" \"C\",","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"character value formula calculating total carbon stock specific land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"","code":"library(mocaredd) library(readxl) library(dplyr) cs <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) c_lu <- cs |> filter(lu_id == \"dg_ev_wet_closed\") c_check <- fct_check_pool(.c_lu = c_lu, .c_unit = \"C\", .c_fraction = NA) fct_make_formula(.c_check = c_check, .c_unit = \"C\") #> [1] \"DG_ratio\""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"","code":"fct_make_mcs( .n_iter = 10000, .pdf, .mean = NA, .se = NA, .params = NULL, .trunc = FALSE )"},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":".n_iter Number iterations Monte Carlo simulations .pdf Probability Distribution Function name, supported distributions far: \"normal\", \"beta\". .mean Mean value PDF parameters mean sd .se Standard deviation mean value PDF parameters mean sd .params Vector pf parameters PDFs (IMPLEMENTED YET) .trunc TRUE FALSE, simulations truncated allow values 0 negative values impossible","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"vector N simulation N, number iterations (.n_iter)","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"","code":"library(mocaredd) tt <- fct_make_mcs(.pdf = \"normal\", .mean = 0, .se = 1) hist(tt)"},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"Starts R Shiny application guide users fill context land use changes forest related greenhouse gas emissions removals. Inputs include distribution parameters various distribution app returns error propagation sensitivity analysis overall uncertainty GHG estimates.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"","code":"shiny_run_mocaredd(...)"},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"... arguments pass shinyApp","code":""},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"","code":"if (interactive()) { shiny_run_mocaredd() }"}] +[{"path":"https://openforis.github.io/mocaredd/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 mocaredd authors, Open Foris Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"inital-setup","dir":"Articles","previous_headings":"","what":"Inital setup:","title":"mocaredd - package creation steps","text":"Create Github repository. Create R project Github (See https://happygitwithr.com/ linking Github repos Rstudio). usethis::create_package(\"PATH/mocaredd\") PATH path project folder set project creation. usethis::use_pkgdown() usethis::use_vignette(\"app-generation\", title = \"MCredd - package creation steps\") usethis::use_testthat() usethis::use_mit_license() usethis::use_github_action() advanced workflow: usethis::use_github_action(\"check-full\") usethis::create_from_github(\"openforis/mocaredd\", fork = TRUE, destdir = \"/Users/gaelsola/Github-repos\")","code":""},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"barebone-app","dir":"Articles","previous_headings":"","what":"Barebone app","title":"mocaredd - package creation steps","text":"Add dependencies DESCRIPTION:","code":"usethis::use_package(\"dplyr\")"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"run-all-the-time","dir":"Articles","previous_headings":"","what":"Run all the time:","title":"mocaredd - package creation steps","text":"","code":"devtools::document() devtools::load_all() shiny_run_mocaredd() devtools::install() library(mocaredd) shiny_run_mocaredd()"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"checks","dir":"Articles","previous_headings":"","what":"Checks","title":"mocaredd - package creation steps","text":"","code":"devtools::check() ## Run one time # usethis::use_testthat() usethis::use_r(\"fct_check_data\") usethis::use_test(\"fct_check_data\") usethis::use_test(\"fct_combine_mcs_P\")"},{"path":"https://openforis.github.io/mocaredd/articles/app-build.html","id":"build-pkgdown-website","dir":"Articles","previous_headings":"","what":"Build pkgdown website","title":"mocaredd - package creation steps","text":"","code":"#pkgdown::build_site() usethis::use_pkgdown_github_pages()"},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"https://openforis.github.io/mocaredd/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Gael Sola. Author, maintainer. Javier Garcia Perez. Author. Jimena Saucedo Miranda. Author. Lauri Vesa. Author.","code":""},{"path":"https://openforis.github.io/mocaredd/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sola G, Garcia Perez J, Saucedo Miranda J, Vesa L (2024). mocaredd: Monte Carlo Simulation REDD+ uncertainty analysis. R package version 0.0.0.9000, https://openforis.github.io/mocaredd/, https://github.com/openforis/mocaredd.","code":"@Manual{, title = {mocaredd: Monte Carlo Simulation for REDD+ uncertainty analysis}, author = {Gael Sola and Javier {Garcia Perez} and Jimena {Saucedo Miranda} and Lauri Vesa}, year = {2024}, note = {R package version 0.0.0.9000, https://openforis.github.io/mocaredd/}, url = {https://github.com/openforis/mocaredd}, }"},{"path":"https://openforis.github.io/mocaredd/index.html","id":"mocaredd-monte-carlo-simulations-for-redd-uncertainty-analysis","dir":"","previous_headings":"","what":"Monte Carlo Simulation for REDD+ uncertainty analysis","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"Contains functions shiny app (1) setting , (2) running Monte Carlo Simulations (3) producing improved estimates confidence intervals around greenhouse gas emissions emission reductions forestry sector. apps takes input XLSX file following specific template meant harmonize reporting areas land use transitions associated carbon stocks. provides simulations, medians, percentage uncertainties confidence intervals various stages aggregation emissions related land use transitions REDD+ activities emission reductions reference monitoring periods.  ","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"workflow","dir":"","previous_headings":"","what":"Workflow","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"Input XSLX filled following provided template. (Note v2.0, accept separated CSV files, format tbd). Checks run ensure entity codes unique matching tables. Simulations produced results can seen forest plots, simulations densities comparison simulations arithmetic means final emission reductions. Sensitivity analysis shows impact AE vs EF, REDD+ activities, time periods.","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"calculation-steps","dir":"","previous_headings":"","what":"Calculation steps","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"template","dir":"","previous_headings":"","what":"Template","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"(ADD Link template github ) template includes 4 tabs:","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"user-inputs-user_inputs","dir":"","previous_headings":"Template","what":"User inputs (user_inputs)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"help offering great flexibility minimum number parameters. trunc_pdf: use truncated PDF avoid negative simulated values illogical (ex. areas.). (Note v2.0, currently works normal distributions). n_iter: number iterations. standards require 10,000 simulations. ran_seed: rand seed simulation. note specified, first run sets random seed reports reproducing results. c_unit: AGB abd BGB, unit dry matter (DM) carbon (C)? dg_pool: degradation ratio intact forest Cstock, list pools separated coma ratio applies. dg_expool: (experimental) Pools excluded degradation process (may redundant). ad_annual: Activity Data reported annual sum time period considered? (TRUE FALSE). conf_level: Confidence level (1 - alpha) uncertainty calculations.","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"time-periods-time_periods","dir":"","previous_headings":"Template","what":"Time periods (time_periods)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"land-use-transitions-ad_lu_transitions","dir":"","previous_headings":"Template","what":"land use transitions (AD_lu_transitions)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"carbon-stocks-c_stocks","dir":"","previous_headings":"Template","what":"Carbon stocks (c_stocks)","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/index.html","id":"road-map-of-future-developements","dir":"","previous_headings":"","what":"Road map of future developements","title":"Monte Carlo Simulation for REDD+ uncertainty analysis","text":"load input csv Include various soil organic carbon method Include removals","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"Monte Carlo simulations package functions generate table one row = one simulation. fct_calc_res() takes simulation table output simulated variable's median confidence interval selected category (land use transition, REDD+ activity time period).","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"","code":"fct_calc_res(.data, .id, .sim, .ci_alpha)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":".data data frame containing simulation aggregated results .id name ID column data frame .sim name column containing simulated values .ci_alpha alpha value confidence interval confidence level = 1 - alpha.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"tibble simulation results per category ID column: estimated mean, percentage uncertainty, margin error, lower upper bound confidence interval.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_calc_res.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate median and confidence interval based on Monte Carlo Simulations — fct_calc_res","text":"","code":"## TBD"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"","code":"fct_check_data(.ad, .cs, .init)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":".ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .init initial list coded variables carbon pools REDD+ activity check imported data .","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"dataframe TRUE FALSE flag, (TRUE meaning flag raised issue detected).","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_check_data","text":"","code":"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"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's input data meet the template criteria. — fct_check_data2","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"Tests 6 types conformity app template avoid code break analysis: (1) column names, (2) tables' size, (3) data types, (4) categories names, (5) unique IDs (6) matching key variables tables.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"","code":"fct_check_data2(.usr, .time, .ad, .cs, .checklist)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":".usr User inputs' table shiny app (user_inputs) .time 'time' table tool input file (see template) .ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .checklist list coded category variables used template.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"dataframe TRUE FALSE (TRUE check passes), broad error locations FALSE.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_data2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's input data meet the template criteria. — fct_check_data2","text":"","code":"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\" ) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) time <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"time_periods\", na = \"NA\" ) app_checklist <- list( xlsx_tabs = c(\"user_inputs\", \"time_periods\", \"AD_lu_transitions\", \"c_stocks\"), cat_cunits = c(\"DM\", \"C\"), cat_cpools = c(\"AGB\", \"BGB\", \"DW\", \"LI\", \"SOC\", \"ALL\"), cat_racti = c(\"DF\", \"DG\", \"EN\", \"EN_AF\", \"EN_RE\"), cat_ptype = c(\"REF\", \"REF[0-9]\", \"MON\", \"MON[0-9]\"), cat_pdf = c(\"normal\", \"beta\"), col_usr = c(\"trunc_pdf\", \"n_iter\", \"ran_seed\", \"c_unit\", \"c_fraction\", \"dg_pool\", \"dg_expool\", \"ad_annual\", \"conf_level\"), col_time = c(\"period_no\", \"year_start\", \"year_end\", \"period_type\"), col_ad = c(\"trans_no\", \"trans_id\", \"trans_period\", \"redd_activity\", \"lu_initial_id\", \"lu_initial\", \"lu_final_id\", \"lu_final\", \"trans_area\", \"trans_se\", \"trans_pdf\", \"trans_pdf_a\", \"trans_pdf_b\", \"trans_pdf_c\"), col_cs = c(\"c_no\", \"c_id\", \"c_period\", \"lu_id\", \"lu_name\", \"c_pool\", \"c_value\", \"c_se\", \"c_pdf\", \"c_pdf_a\", \"c_pdf_b\", \"c_pdf_c\") ) app_checklist$cat_cpools_all <- c(app_checklist$cat_cpools, \"RS\", \"DG_ratio\") fct_check_data2(.ad = ad, .cs = cs, .usr = usr, .time = time, .checklist = app_checklist) #> $cols_ok #> [1] TRUE #> #> $size_ok #> [1] TRUE #> #> $datatypes_ok #> [1] TRUE #> #> $cats_ok #> [1] TRUE #> #> $ids_ok #> [1] TRUE #> #> $matches_ok #> [1] TRUE #> #> $all_ok #> [1] TRUE #> #> $pbs #> named list() #>"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":null,"dir":"Reference","previous_headings":"","what":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"expected input carbon stock table tool contains carbon values different carbon pools coded: - AGB aboveground biomass, - BGB RS (Root--Shoot ratio) belowground biomass, - DW deadwood, - LI litter - SOC soil organic carbon. pools can expressed tons Carbon (C) CO2. AGB BGB can also expressed ton dry matter (DM), carbon fraction (CF) also needed.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"","code":"fct_check_pool(.c_lu, .c_unit, .c_fraction)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":".c_lu Subset Carbon Stock input table (c_stock) unique land use .c_unit Unit used report AGB (BGB included), shiny app template user inputs. .c_fraction Value carbon fraction, dry matter reported","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"dataframe TRUE FALSE pool factor app's carbon stock input data given land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_check_pool.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check which Carbon pool and what units are in the carbon stock data. — fct_check_pool","text":"","code":"library(mocaredd) library(readxl) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union cs <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) c_lu <- cs |> filter(lu_id == \"ev_wet_closed\") fct_check_pool(.c_lu = c_lu, .c_unit = \"C\", .c_fraction = NA) #> lu_id lu_name has_AG has_BG has_RS has_DW has_LI has_SO #> 1 ev_wet_closed Closed Wet Evergreen TRUE TRUE FALSE TRUE TRUE TRUE #> has_AL has_CF has_DG #> 1 FALSE FALSE FALSE"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"","code":"fct_combine_mcs_C(.c_sub, .usr)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":".c_sub Subset one land use carbon stock input table shiny app (c_stocks). .usr User inputs' table shiny app (user_inputs). Contains number iterations MCS, carbon fraction needed truncated PDFs used necessary.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"data frame N simulations carbon pool associated factors resulting total carbon stock tCO2/ha.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_C.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Monte Carlo Simulations and calculate carbon stock for all pools — fct_combine_mcs_C","text":"","code":"library(dplyr) library(readxl) library(mocaredd) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) cs <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) cs_clean <- cs |> filter(!(is.na(c_value) & is.na(c_pdf_a))) c_sub <- cs_clean |> filter(lu_id == \"ev_wet_closed\") res <- fct_combine_mcs_C(.c_sub = c_sub, .usr = usr) hist(res$C_all) round(median(res$C_all)) #> [1] 453"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"","code":"fct_combine_mcs_E(.ad, .cs, .usr)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":".ad Activity Data input table shiny app (AD_lu_transitions) .cs Carbon Stock input table shiny app (c_stocks) .usr User inputs' table shiny app (user_inputs). Contains number iterations MCS, carbon fraction needed truncated PDFs used necessary.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"list dataframes Monte Carlo simulations input variables, REDD+ activities CO2 emissions removals emission reductions levels.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_E.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate and propagate Monte Carlo Simulations based on a template input file. — fct_combine_mcs_E","text":"","code":"library(readxl) library(dplyr) library(mocaredd) cs <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) ad <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"AD_lu_transitions\", na = \"NA\" ) usr <- read_xlsx( system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) cs_clean <- cs |> filter(!is.na(c_value) | !is.na(c_pdf_a)) res <- fct_combine_mcs_E(.ad = ad, .cs = cs_clean, .usr = usr) #> Random simulations with seed: 93 hist(res$E_sim) round(median(res$E_sim)) #> [1] 75830"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"Depending period defined data annualized , calculate Emission Level reference monitoring period simulation.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"","code":"fct_combine_mcs_P(.data, .time, .period_type, .ad_annual)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":".data data frame containing simulations .time 'time' table tool input file (see template) .period_type \"reference\" \"monitoring\" .ad_annual TRUE FALSE, activity data annualized .","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"tibble simulations final estimate per type period.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_combine_mcs_P.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine MCS of emissions to a defined time period — fct_combine_mcs_P","text":"","code":"library(readxl) library(dplyr) library(mocaredd) 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\" ) usr <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"user_inputs\", na = \"NA\" ) time <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"time_periods\", na = \"NA\" ) ad_clean <- ad |> dplyr::filter(!is.na(trans_area) | !is.na(trans_pdf_a)) cs_clean <- cs |> dplyr::filter(!is.na(c_value) | !is.na(c_pdf_a)) time_clean <- time |> dplyr::mutate(nb_years = year_end - year_start + 1) sim_trans <- fct_combine_mcs_E(.ad = ad_clean, .cs = cs_clean, .usr = usr) #> Random simulations with seed: 93 sim_FREL <- fct_combine_mcs_P( .data = sim_trans, .time = time_clean, .period_type = \"REF\", .ad_annual = usr$ad_annual ) hist(sim_FREL$E_sim) round(median(sim_FREL$E_sim)) #> [1] 4591614"},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"Produce gt table median confidence interval Monte Carlo simulations category level analysis (land use transition, REDD+ activity, time period) forest plot showing median CI together.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"","code":"fct_forestplot( .data, .id, .value, .uperc, .cilower, .ciupper, .id_colname, .conflevel, .filename )"},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":".data data frame containing simulation aggregated results .id name ID column data frame .value name value column data frame (.e median simulations) .uperc name percentage uncertainty simulations .cilower name lower end confidence interval .ciupper name higher end confidence interval .id_colname character text ID column names. goes gt::md() gt::cols_label() .conflevel character text specify confidence level used, ex. \"90%\". .filename path save table NA.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_forestplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a forest plot to show Monte Carlo simulation results — fct_forestplot","text":"character value formula calculating total carbon stock specific land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate histogram to show the simulations at any stage. — fct_histogram","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"Takes simulation data fct_combine_mcs_E() fct_combine_mcs_P() aggregated results fct_calc_res() generate histogram showing PDF density, modeled normal distribution, simulations' median confidence interval.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"","code":"fct_histogram(.data, .res, .id, .value, .value_type, ...)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":".data data frame simulated data. Output fct_combine_mcs_E() fct_combine_mcs_P(). .res aggregated results simulation. Output fct_calc_res() .id ID column .data .res inputs. .value simulated values column .data. .value_type \"E\" \"ER\" .data represents emissions emission reductions respectively. ... filter query, passed dplyr::filter().","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_histogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate histogram to show the simulations at any stage. — fct_histogram","text":"ggplot named list ggplots","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"expected input carbon stock table tool contains carbon values different carbon pools coded: - AGB aboveground biomass, - BGB RS (Root--Shoot ratio) belowground biomass, - DW deadwood, - LI litter - SOC soil organic carbon. pools can expressed tons Carbon (C) CO2. AGB BGB can also expressed ton dry matter (DM), carbon fraction (CF) also needed.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"","code":"fct_make_formula(.c_check, .c_unit)"},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":".c_check output fct_check_pool() .c_unit \"DM\" \"C\",","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"character value formula calculating total carbon stock specific land use.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_formula.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that the app's the input data has matching land uses and correct carbon pools and associated factors. — fct_make_formula","text":"","code":"library(mocaredd) library(readxl) library(dplyr) cs <- read_xlsx( path = system.file(\"extdata/example1.xlsx\", package = \"mocaredd\"), sheet = \"c_stocks\", na = \"NA\" ) c_lu <- cs |> filter(lu_id == \"dg_ev_wet_closed\") c_check <- fct_check_pool(.c_lu = c_lu, .c_unit = \"C\", .c_fraction = NA) fct_make_formula(.c_check = c_check, .c_unit = \"C\") #> [1] \"DG_ratio\""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"TBD","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"","code":"fct_make_mcs( .n_iter = 10000, .pdf, .mean = NA, .se = NA, .params = NULL, .trunc = FALSE )"},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":".n_iter Number iterations Monte Carlo simulations .pdf Probability Distribution Function name, supported distributions far: \"normal\", \"beta\". .mean Mean value PDF parameters mean sd .se Standard deviation mean value PDF parameters mean sd .params Vector pf parameters PDFs (IMPLEMENTED YET) .trunc TRUE FALSE, simulations truncated allow values 0 negative values impossible","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"vector N simulation N, number iterations (.n_iter)","code":""},{"path":"https://openforis.github.io/mocaredd/reference/fct_make_mcs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Monte Carlo Simulations for a given PDF — fct_make_mcs","text":"","code":"library(mocaredd) tt <- fct_make_mcs(.pdf = \"normal\", .mean = 0, .se = 1) hist(tt)"},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"Starts R Shiny application guide users fill context land use changes forest related greenhouse gas emissions removals. Inputs include distribution parameters various distribution app returns error propagation sensitivity analysis overall uncertainty GHG estimates.","code":""},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"","code":"shiny_run_mocaredd(...)"},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"... arguments pass shinyApp","code":""},{"path":"https://openforis.github.io/mocaredd/reference/shiny_run_mocaredd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run Monte Carlo for REDD+ uncertainty's shiny app — shiny_run_mocaredd","text":"","code":"if (interactive()) { shiny_run_mocaredd() }"}]