| Title: | Report Production from Marteloscopes with Capsis |
|---|---|
| Description: | The goal of this package is to help users in using Capsis softawre and compile reports for field workshops. The workshop consist in predicting management effects on forest stand within the capsis platform. |
| Authors: | Maxime Jaunatre [aut, cre, trl] (ORCID: <https://orcid.org/0009-0002-2816-1677>), INRAE [cph], Benoit Courbaud [aut] (ORCID: <https://orcid.org/0000-0002-3050-9559>) |
| Maintainer: | Maxime Jaunatre <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-05-22 13:40:07 UTC |
| Source: | https://forge.inrae.fr/lessem/rpackages/martelosim |
Build Samsara txt files from xlsx inventory
build_samsa2_files( file = file.path("data", sprintf("Data_Marteloscope_%s.xlsx", getOption("mart_site"))), verbose = TRUE )build_samsa2_files( file = file.path("data", sprintf("Data_Marteloscope_%s.xlsx", getOption("mart_site"))), verbose = TRUE )
file |
inventory file in xlsx, by default Data_marteloscope_<site>.xlsx |
verbose |
Allow to print messages. False by default. |
Check tinytex
check_tinytex_dep(verbose = FALSE)check_tinytex_dep(verbose = FALSE)
verbose |
sho messages |
Open or message marking file
find_marking(open = TRUE, verbose = TRUE)find_marking(open = TRUE, verbose = TRUE)
open |
Open files with sheet editor. TRUE by default |
verbose |
Write nice messages, TRUE by default |
Sapplings height classes
HClassesHClasses
An object of class data.frame with 4 rows and 3 columns.
Benoit Courbaud
iplus traduction for martelage
iplus_actioniplus_action
An object of class data.frame with 4 rows and 3 columns.
Benoit Courbaud
iplus traduction for martelage
iplus_reasoniplus_reason
An object of class data.frame with 11 rows and 3 columns.
Benoit Courbaud
Plots color scales for reports
mart_scalesmart_scales
An object of class list of length 9.
Benoit Courbaud
Render maps for field identification of interesting trees
martelo_maps()martelo_maps()
Create a pdf file.
Render report for one group
martelo_report( marking_groups = "X", dendrometry = TRUE, regeneration = TRUE, light = TRUE, harvest = TRUE, carbon = TRUE, biodiversity = TRUE, rockfall = TRUE, snow = TRUE, economy = TRUE, multi = FALSE )martelo_report( marking_groups = "X", dendrometry = TRUE, regeneration = TRUE, light = TRUE, harvest = TRUE, carbon = TRUE, biodiversity = TRUE, rockfall = TRUE, snow = TRUE, economy = TRUE, multi = FALSE )
marking_groups |
Group Name. Must be a group present. |
dendrometry |
Print the page about this subject. TRUE by default. |
regeneration |
Print the page about this subject. TRUE by default. |
light |
Print the page about this subject. TRUE by default. |
harvest |
Print the page about this subject. TRUE by default. |
carbon |
Print the page about this subject. TRUE by default. |
biodiversity |
Print the page about this subject. TRUE by default. |
rockfall |
Print the page about this subject. TRUE by default. |
snow |
Print the page about this subject. TRUE by default. |
economy |
Print the page about this subject. TRUE by default. |
multi |
Render a different report with only comparative plots |
Create a pdf file.
Report production from marteloscopes with Capsis
The goal of this package is to help users in using Capsis softawre and compile reports for field workshops. The workshop consist in predicting management effects on forest stand within the capsis platform.
Maintainer: Maxime Jaunatre [email protected] (ORCID) [translator]
Authors:
Benoit Courbaud [email protected] (ORCID)
Other contributors:
INRAE [copyright holder]
Useful links:
Choose with what column you need to fill the tree points
martelosim_evol(data, y_col, fill_col, fill_scale, ...)martelosim_evol(data, y_col, fill_col, fill_scale, ...)
data |
data.frame with columns Year. |
y_col |
column to use for y axis of the plot. Col is because it's geom_area |
fill_col |
column on which to fill. Write as ggplot input in |
fill_scale |
manual fill scale to be given as values in |
... |
scales for action shape and color. color_scale and shape_scale values are set |
Choose with what column you need to fill the tree points
martelosim_hist(data, x, y, fill, fill_scale, ...)martelosim_hist(data, x, y, fill, fill_scale, ...)
data |
data.frame with columns Year. |
x |
column to plot in x |
y |
column to plot in y |
fill |
column on which to fill. Write as ggplot input in |
fill_scale |
manual fill scale to be given as values in |
... |
scales for action shape and color. color_scale and shape_scale values are set |
Choose with what column you need to fill the tree points
martelosim_map( data, fill_col, fill_scale, poly, label = FALSE, action = FALSE, limits = NULL, ... )martelosim_map( data, fill_col, fill_scale, poly, label = FALSE, action = FALSE, limits = NULL, ... )
data |
data.frame with columns X_m, Y_m, D_cm, Id. Two first are the position of trees, Id a label, D_cm the diameter. |
fill_col |
column on which to fill. Write as ggplot input in |
fill_scale |
manual fill scale to be given as values in |
poly |
polygon of the marteloscope. From inventory |
label |
TRUE FALSE add labels to trees |
action |
TRUE FALSE add action shape and color to plot. |
limits |
NULL by default. Recompute x and y scales |
... |
scales for action shape and color. color_scale and shape_scale values are set |
Log some options for the project.
martelosim_options( capsis_exe_path, site, date, animateur, mail_animateur, lang = c("en", "fr"), verbose = TRUE )martelosim_options( capsis_exe_path, site, date, animateur, mail_animateur, lang = c("en", "fr"), verbose = TRUE )
capsis_exe_path |
capsis executable path |
site |
Name of the marteloscope site |
date |
Date of the marteloscope exercise |
animateur |
Name of the site animateur |
mail_animateur |
Contact for the animateur |
lang |
Language, still in development |
verbose |
Print nice messages. TRUE by default |
Choose with what column you need to fill the tree points
martelosim_pixelmap( data, treedata, fill_col, fill_scale, poly, action = FALSE, limits = NULL, ... )martelosim_pixelmap( data, treedata, fill_col, fill_scale, poly, action = FALSE, limits = NULL, ... )
data |
data.frame with columns X_m, Y_m, Cell_Id. Intended for polygons plots |
treedata |
data.frame with X_m, Y_m, D_cm and Action columns Two first are the position of trees, Id a label, D_cm the diameter. |
fill_col |
column on which to fill. Write as ggplot input in |
fill_scale |
manual fill scale to be given as values in |
poly |
polygon of the marteloscope. From inventory |
action |
TRUE FALSE add action shape and color to plot. |
limits |
NULL by default. Recompute x and y scales |
... |
scales for action shape and color. color_scale and shape_scale values are set |
Create a new inventory from previous marteloscope
new_inventory( inv_site = c("new", "copy", "Prelenfrey", "Soteska", "Bouges", "Brauze_1", "Crocq", "LaChaume", "Brin", "Rindbach", "Nevegal", "Sailershausen1", "Schneidersrangen", "ColDePorte", "ColDeLEpine", "Krivoklat", "Collemeluccio", "Haugimont"), inv_file = NULL, lang = c("en", "fr"), open = TRUE, verbose = FALSE )new_inventory( inv_site = c("new", "copy", "Prelenfrey", "Soteska", "Bouges", "Brauze_1", "Crocq", "LaChaume", "Brin", "Rindbach", "Nevegal", "Sailershausen1", "Schneidersrangen", "ColDePorte", "ColDeLEpine", "Krivoklat", "Collemeluccio", "Haugimont"), inv_file = NULL, lang = c("en", "fr"), open = TRUE, verbose = FALSE )
inv_site |
name of the site. If the site exist, it will initiate xlsx file for the users. If not, it propose a new empty file (default). |
inv_file |
NULL by default. If copy, the file to copy in active directory |
lang |
language, default is "en" but "fr" can be selected. "fr" option is not fully developped. |
open |
boolean, allow to lauch excell or libre office if available |
verbose |
Allow to print messages. False by default. |
The file name is always Data_Marteloscope_<inv_site>.xlsx and is stored in data/
Write command file for launching samsara2 software and prepare plot
prepare_samsara( create_periphery = TRUE, create_virtual_saplings = TRUE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, memory_perc = 75, verbose = FALSE )prepare_samsara( create_periphery = TRUE, create_virtual_saplings = TRUE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, memory_perc = 75, verbose = FALSE )
create_periphery |
Creation of the periphery of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
create_virtual_saplings |
Creation of the saplings of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
range_dbh |
range of dbh for tree diameter classes. |
inv_year |
year of the inventory. Used to define the starting year of simulations. Value retrievedfrom inventory file. |
inv_mindbh |
inventory minimum dbh. Value retrieved from inventory file. |
simulation_year_step |
Simulation year step, value by default is 1. |
memory_perc |
Percentage of computer RAM affected to CAPSIS. default is 75%. |
verbose |
Print messages or not. |
Write a random marking file
random_marking(name = "Random", verbose = TRUE, open = FALSE)random_marking(name = "Random", verbose = TRUE, open = FALSE)
name |
name of the marking. Default is "Random" |
verbose |
Print nice messages. TRUE by default |
open |
Open the file. FALSE by default |
Run Samsara software
run_samsara( commandFile = sprintf("%s_Martelo_CommandFile.txt", getOption("mart_site")), combineOutputs = TRUE, memory_perc = 75, verbose = TRUE )run_samsara( commandFile = sprintf("%s_Martelo_CommandFile.txt", getOption("mart_site")), combineOutputs = TRUE, memory_perc = 75, verbose = TRUE )
commandFile |
Default command file to use is the one with the site name. |
combineOutputs |
Not used yet, if needs to combine outputs |
memory_perc |
75 percentage of RAM is used by default if memory > 4Gb. |
verbose |
print logs in terminal or not. TRUE by default |
Write command file for launching samsara2 software and prepare plot
write_prep_samsara_cmd( create_periphery = TRUE, create_virtual_saplings = TRUE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, verbose = FALSE )write_prep_samsara_cmd( create_periphery = TRUE, create_virtual_saplings = TRUE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, verbose = FALSE )
create_periphery |
Creation of the periphery of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
create_virtual_saplings |
Creation of the saplings of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
range_dbh |
range of dbh for tree diameter classes. |
inv_year |
year of the inventory. Used to define the starting year of simulations. Value retrievedfrom inventory file. |
inv_mindbh |
inventory minimum dbh. Value retrieved from inventory file. |
simulation_year_step |
Simulation year step, value by default is 1. |
verbose |
Print messages or not. |
Write command file for launching samsara2 software
write_samsara_cmd( marking_groups, thinning_time, evolution_time, create_periphery = FALSE, create_virtual_saplings = FALSE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, silviculture = c("auto", "expert"), verbose = FALSE )write_samsara_cmd( marking_groups, thinning_time, evolution_time, create_periphery = FALSE, create_virtual_saplings = FALSE, range_dbh = c(as.numeric(getOption("mart_recdbh")), 92.5), inv_year = as.numeric(getOption("mart_year")), inv_mindbh = as.numeric(getOption("mart_recdbh")), simulation_year_step = 1, silviculture = c("auto", "expert"), verbose = FALSE )
marking_groups |
list of marking_groups to build the command file for. Under development so it use all marking_groups at this time |
thinning_time |
Time between management actions |
evolution_time |
Total duration of the simulation |
create_periphery |
Creation of the periphery of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
create_virtual_saplings |
Creation of the saplings of the plot. TRUE by default. Must be TRUE for the first simulation, and FALSE later to speed up simulations |
range_dbh |
range of dbh for tree diameter classes. |
inv_year |
year of the inventory. Used to define the starting year of simulations. Value retrievedfrom inventory file. |
inv_mindbh |
inventory minimum dbh. Value retrieved from inventory file. |
simulation_year_step |
Simulation year step, value by default is 1. |
silviculture |
Choice between "auto" and "expert", for building data/Silviculture file. |
verbose |
Print messages or not. |