| Title: | Routines for Evaluating Forest Inventory Data |
|---|---|
| Description: | Provides a collection of routines for evaluating data from larger forest management units, typically sample inventories, but also stand-wise inventories. The idea is to support modern forest planning approaches and to be open by design to new data sources and evaluation methods. For the methodological background of forest inventories see Kangas and Maltamo (2006) "Forest Inventory: Methodology and Applications" <doi:10.1007/1-4020-4381-3>. |
| Authors: | Peter Biber [aut, cre] (ORCID: <https://orcid.org/0000-0002-9700-8708>), Astor Toraño Caicoya [aut] (ORCID: <https://orcid.org/0000-0002-9658-8990>) |
| Maintainer: | Peter Biber <[email protected]> |
| License: | AGPL (>= 3) |
| Version: | 3.0.2 |
| Built: | 2026-10-09 10:50:40 UTC |
| Source: | https://github.com/cran/FeNEU |
Calculates the quadratic mean diameter on the nested levels of layer in species group in plot, attributes these values to categories which are the basis for further aggregation with other functions. The function was designed for producing often required information only once.
back_table_dclass(inv_trees_plus, d_q_interval = 10)back_table_dclass(inv_trees_plus, d_q_interval = 10)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
d_q_interval |
Integer indicating the interval breaks for the d_q
(quadratic mean diameter) classes to be formed. The breaks are internally
handed over to |
A data frame which reports for each plot, species group and layer the actual quadratic mean diameter and the d_q-class (as an ordered factor) it belongs to.
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> back_table_dclass()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> back_table_dclass()
Inventory tree data are grouped by species group and age class. A data frame with group-wise aggregated inventory information is returned.
base_table_age_class(inv_trees_plus, tree_filter = !.data$removal)base_table_age_class(inv_trees_plus, tree_filter = !.data$removal)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
tree_filter |
Expression describing which trees to use in the function,
internally passed to |
A list containing four data frames. The first one, called detail
contains the aggregated information by species group and
age class. The second one, total is aggregated on species level, i.e. one
level higher. These values are mostly sums, but not in all cases.
Confidence intervals must be calculated differently and also
n_plot in total will not always be the sum of the values in
detail, as there might be plots which contain two layers with different
d_q classes. The third data frame, all_species, holds the cross-species
aggregation by age class (the body of the "Summe" block of the base table
(Basistabelle)); the fourth, all_total, is the grand total across all species and
all classes.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> base_table_age_class()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> base_table_age_class()
Species Group Information Table by Age Class For the Main Stand Cohort
base_table_age_class_main_stand(inv_trees_plus)base_table_age_class_main_stand(inv_trees_plus)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
A list containing four data frames, similar as the output from
base_table_age_class, however restricted to the main stand,
but with information about the areas covered by species (sub-groups).
The first data frame in the list, called detail contains the aggregated
information by species group and age class. The second one, total is
aggregated on species level, i.e. one level higher. These values are mostly
sums, but not in all cases. Confidence intervals must be calculated
differently. The third data frame, all_species, holds the cross-species
aggregation by age class (the body of the "Summe" block of the base table
(Basistabelle)); the fourth, all_total, is the grand total across all species and
all classes.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> base_table_age_class_main_stand()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. data_ex3_sample_trees_essentials |> base_table_age_class_main_stand()
Inventory tree data are grouped by species group and mean diameter class. A data frame with group-wise aggregated inventory information is returned.
base_table_d_q_class(inv_trees_plus, dclass_back, tree_filter = !.data$removal)base_table_d_q_class(inv_trees_plus, dclass_back, tree_filter = !.data$removal)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
dclass_back |
Data frame listing quadratic mean diameter classes per
species group and layer on plot level. Typically the output of
|
tree_filter |
Expression describing which trees to use in the function,
internally passed to |
A list containing four data frames. The first one, called detail
contains the aggregated information by
species group and mean diameter class. The second data frame, total is
aggregated on species level, i.e. one level higher. These values are mostly
sums, but not in all cases. Confidence intervals must be calculated
differently and also n_plot in total will not always be the sum of
the values in detail, as there might be plots which contain two layers
with different d_q classes. The third data frame, all_species, holds the
cross-species aggregation by mean diameter class (the body of the "Summe"
block of the base table (Basistabelle)); the fourth, all_total, is the grand total
across all species and all classes.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. trees_with_heights <- data_ex3_sample_trees_essentials peg_back_d <- back_table_dclass(trees_with_heights) base_table_d_q_class(trees_with_heights, dclass_back = peg_back_d)# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. trees_with_heights <- data_ex3_sample_trees_essentials peg_back_d <- back_table_dclass(trees_with_heights) base_table_d_q_class(trees_with_heights, dclass_back = peg_back_d)
Very similar aggregation table to the one produced by
base_table_d_q_class, but restricted to to the main stand
(layer_key == 1) only. It contains, however, estimates of areas covered by
species (sub-)groups and ha-related values o these cohorts. Due the
methodological dubiousness of species area calculations in mixed stands, this
is only done for the main stand (comparably to how this was handled in the
3rd German National Forest Inventory).
base_table_d_q_class_main_stand(inv_trees_plus, dclass_back)base_table_d_q_class_main_stand(inv_trees_plus, dclass_back)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
dclass_back |
Data frame listing quadratic mean diameter classes per
species group and layer on plot level. Typically the output of
|
A list containing four data frames, similar as the output from
base_table_d_q_class, however restricted to the main stand,
but with information about the areas covered by species (sub-groups).
The first data frame in the list, called detail contains the aggregated
information by species group and mean diameter class. The second one,
total is aggregated on species level, i.e. one level higher. These values
are mostly sums, but not in all cases. Confidence intervals must be
calculated differently. The third data frame, all_species, holds the
cross-species aggregation by mean diameter class (the body of the "Summe"
block of the base table (Basistabelle)); the fourth, all_total, is the grand total
across all species and all classes.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. trees_with_heights <- data_ex3_sample_trees_essentials peg_back_d <- back_table_dclass(trees_with_heights) base_table_d_q_class_main_stand( trees_with_heights, dclass_back = peg_back_d )# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. trees_with_heights <- data_ex3_sample_trees_essentials peg_back_d <- back_table_dclass(trees_with_heights) base_table_d_q_class_main_stand( trees_with_heights, dclass_back = peg_back_d )
Gate function called at the top of every *_pdf() function. Throws an
informative error when rmarkdown, kableExtra, or pandoc is
missing, so users get a clear install message rather than a cryptic
backtrace from inside rmarkdown::render().
check_pdf_dependencies(fun_name)check_pdf_dependencies(fun_name)
fun_name |
Character string — the name of the calling |
NULL invisibly when all dependencies are present.
pdf_dependencies, diagnose_pdf_toolchain
Other pdf_output:
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# The gate every *_pdf() function calls first: silent when everything is in # place, an informative error otherwise. Guarded here so that the example # itself stays harmless on a machine without the toolchain. if (requireNamespace("kableExtra", quietly = TRUE) && rmarkdown::pandoc_available()) { check_pdf_dependencies("output_base_table_pdf") }# The gate every *_pdf() function calls first: silent when everything is in # place, an informative error otherwise. Guarded here so that the example # itself stays harmless on a machine without the toolchain. if (requireNamespace("kableExtra", quietly = TRUE) && rmarkdown::pandoc_available()) { check_pdf_dependencies("output_base_table_pdf") }
Artificial but realistic raw forest inventory tables (tree, plot and
regeneration) in FeNEU's raw data Format 1 for sample
inventories with concentric circles. They describe an inventory of only ten
inventory points. The Gauss-Krueger coordinates in the point table are random
numbers and do not refer to any real location. Only the columns the Format-1
converter consumes are kept (see
import_sample_concentric_format1_raw_to_pre).
Plot table linked by plot_id.
Tree table linked by plot_id.
Regeneration table linked by plot_id.
Internal example data (artificial, Format 1)
Other example data:
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Artificial but realistic raw forest inventory tables (plot and tree data) in
FeNEU's raw data format 2 for sample inventories. They describe an
inventory in the style of the Bavarian State Forest Enterprise (BaySF),
comprising only ten inventory points. Any stored coordinates are random
numbers and do not refer to any real location.
Plot table linked by koord.
Tree table linked by koord.
Internal example data (artificial, BaySF style)
Other example data:
data_ex1_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
The repeated-survey increment runs through several steps, each of them an exported function with its own help page. The first two steps are shipped here as ready-made objects, so that the examples of the later steps can start at their own subject instead of rebuilding the chain that leads up to it.
data_ex3_increment_matched data_ex3_increment_fillsdata_ex3_increment_matched data_ex3_increment_fills
data_ex3_increment_matched is a list of six elements:
tree_increments (152 rows, 22 columns), plot_matches,
match_plot_stats, match_tree_stats, inv_period and
method ("rep_classic").
data_ex3_increment_fills is a list of five estimate data frames –
fills_forward (31 rows), fills_backward (47),
fills_backward_nomatch (0), fills_backward_implausible (1)
and fills_backward_reptrees (56) – plus inv_period,
plot_matches and method carried through from the matching.
An object of class list of length 6.
An object of class list of length 8.
data_ex3_increment_matched is what matching the two surveys yields:
the per-tree increments derived from the measured data of both
surveys, together with the plot and tree matching statistics and the survey
period.
data_ex3_increment_fills holds the GNFI 3 estimates that stand
ready to fill the gaps the matching leaves – trees found in only one of the
surveys, and trees whose match was flagged implausible. It is not a filled
tree list: which of these estimates is actually used is decided one step
later by inv_inc_tree_consolidate through its
fill_option. Because it was built with include_reptrees = TRUE,
it also carries estimates for trees measured in both surveys, which
have no gap at all; fill_option = "all_estimates" needs those.
These objects exist for the documentation and the test suite, not as a
processing stage of their own. They are built in
data-raw/data_ex3_increment_interim.R from the shipped ex3 inventory
pair and its prepared tree lists
(data_ex3_trees_essentials):
data_ex3_increment_matched <- inv_increment_repsurv_ccirc( data_ex3_previous_sample_fe_inventory, data_ex3_sample_fe_inventory, data_ex3_previous_sample_trees_essentials, data_ex3_sample_trees_essentials, match_type = "plot_id", plot_id_style = "baysf" ) data_ex3_increment_fills <- inv_inc_fill_gaps_gnfi3( data_ex3_increment_matched, data_ex3_previous_sample_trees_essentials, data_ex3_sample_trees_essentials, include_reptrees = TRUE )
Those are the settings the examples use throughout. An example that
deliberately shows a different one – another increment method, matching by
centre coordinates, or include_reptrees = FALSE – calls the function
itself, because that difference is its subject. Whenever the increment chain
changes, these objects have to be rebuilt with the script above, just like
the prepared tree lists.
inv_increment_repsurv_ccirc and
inv_inc_fill_gaps_gnfi3, the functions that produce them;
inv_increment_repeated_survey, which runs the whole chain in
one call and is what most users want.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
# Start at the consolidation step, without rebuilding what precedes it inv_inc_tree_consolidate( data_ex3_increment_fills, fill_option = "standard" )# Start at the consolidation step, without rebuilding what precedes it inv_inc_tree_consolidate( data_ex3_increment_fills, fill_option = "standard" )
Example Inventory Data as an fe_inventory object (10 inventory points, earlier survey)
This fe_inventory object holds artificial but
realistic inventory data in the style of the Bavarian State Forest
Enterprise (BaySF). It comprises only ten inventory points and was
generated with fe_inventory from tab-delimited text files.
The stored Gauss-Krueger coordinates are random numbers and do not refer
to any real location. It contains the same inventory points as
data_ex3_sample_fe_inventory and represents the earlier of
two successive surveys (used to demonstrate increment estimation).
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Example Inventory Data as an fe_inventory object (10 inventory points)
This fe_inventory object holds artificial but
realistic inventory data in the style of the Bavarian State Forest
Enterprise (BaySF). It comprises only ten inventory points and was
generated with fe_inventory from tab-delimited text files.
The stored Gauss-Krueger coordinates are random numbers and do not refer
to any real location. Five of the ten inventory points carry small-tree
records, five do not.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
The tree lists of the two ex3 surveys, ready for analysis: heights complete,
volumes, standing areas and species groups added. They are shipped so that
the increment examples can start from a prepared tree list instead of
repeating the five-step preparation in every single @examples block.
data_ex3_sample_trees_essentials data_ex3_previous_sample_trees_essentialsdata_ex3_sample_trees_essentials data_ex3_previous_sample_trees_essentials
Each a tibble with one row per tree and 23 columns, among them
plot_id, tree_id, species_id, species_group,
age_yr, dbh_cm, height_m, n_rep_ha,
area_rep_ha, layer_key, removal, g_m2,
v_hub_m3 and standing_area_m2.
data_ex3_sample_trees_essentials has 139 rows (second survey),
data_ex3_previous_sample_trees_essentials 112 (first survey).
An object of class tbl_df (inherits from tbl, data.frame) with 139 rows and 23 columns.
An object of class tbl_df (inherits from tbl, data.frame) with 112 rows and 23 columns.
These are not a fourth processing stage of the inventory taxonomy
(raw -> pre -> fe_inventory, see
data_examples_overview).
They sit after the import, on the analysis side: an
fe_inventory object carries the inventory, and pulling and
preparing its trees is the first step of evaluating it.
With the canonical chain, spelled out in
data-raw/data_ex3_trees_essentials.R:
trees_with_heights <- inv |> pull_trees() |> height_complete_inventory() inv |> fill_heights_back(trees_with_heights) |> pull_trees() |> trees_add_essentials(method = "BaySF")
The second pull_trees is what makes the chain canonical:
fill_heights_back writes the estimated heights into the
inventory object, so the re-pulled trees carry them in height_m and
none of the estimation helper columns (h_est_m, d_q_cm,
h_q_m) ride along. Folding h_est_m into height_m by hand
instead gives the same increments but a tree list of a different shape –
a difference that has caused real breakage, see inv_inc_tree_extend.
data_ex3_sample_fe_inventory and
data_ex3_previous_sample_fe_inventory, the inventories they
were pulled from; inv_increment_repeated_survey, the usual
consumer.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
# What the two objects are dim(data_ex3_sample_trees_essentials) dim(data_ex3_previous_sample_trees_essentials) names(data_ex3_sample_trees_essentials) # They are ready to use, no preparation needed. The usual consumer is # inv_increment_repeated_survey(); its help page runs the whole chain on # exactly this pair, so it is not repeated here. head(data_ex3_sample_trees_essentials[, c("plot_id", "species_id", "dbh_cm", "height_m", "v_hub_m3")])# What the two objects are dim(data_ex3_sample_trees_essentials) dim(data_ex3_previous_sample_trees_essentials) names(data_ex3_sample_trees_essentials) # They are ready to use, no preparation needed. The usual consumer is # inv_increment_repeated_survey(); its help page runs the whole chain on # exactly this pair, so it is not repeated here. head(data_ex3_sample_trees_essentials[, c("plot_id", "species_id", "dbh_cm", "height_m", "v_hub_m3")])
Example Inventory Data as an fe_inventory object (earlier survey)
This fe_inventory object holds artificial but
realistic inventory data in the style of the Bavarian State Forest
Enterprise (BaySF). It was generated with fe_inventory from
tab-delimited text files. The stored Gauss-Krueger coordinates are random
numbers and do not refer to any real location. It represents the earlier
of two successive surveys and contains the same inventory points as
data_ex4_sample_fe_inventory, except for three points that
were newly established in the later survey; it therefore comprises 97
inventory points.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Example Inventory Data as an fe_inventory object (100 inventory points)
This fe_inventory object holds artificial but
realistic inventory data in the style of the Bavarian State Forest
Enterprise (BaySF). It comprises one hundred inventory points and was
generated with fe_inventory from tab-delimited text files.
The stored Gauss-Krueger coordinates are random numbers and do not refer
to any real location.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Simulated Inventory Data for Generic Matching Tests (10 plots, first survey)
This fe_inventory object was derived from a simulated
forest enterprise (pure spruce, 400 stands, 5 ha each). It contains a
10-plot subsample selected for unique within-plot tree IDs. The original
simulation tree IDs are used as lfd_bhd, making the BaySF tree ID
(paste(lfd_satz, lfd_bhd)) a permanent identifier that is stable
across inventories. This enables testing of tree_id_style = "generic"
(ID-based matching) in inv_increment_repsurv_ccirc.
Seven of the ten plots have both vanished and ingrown trees; three plots
have all trees surviving between surveys. The dataset represents the
first survey (year 2020). See
data_ex5_sample_fe_inventory for the second survey.
Generated by data-raw/simulated_inventory_generic_matching.R.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Simulated Inventory Data for Generic Matching Tests (10 plots, second survey)
This fe_inventory object represents the second survey
(year 2030) of the same 10 plots as
data_ex5_previous_sample_fe_inventory. See that object's documentation
for details on the data source and the permanent tree ID scheme used for
testing tree_id_style = "generic" matching.
Generated by data-raw/simulated_inventory_generic_matching.R.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Stand-Wise Inventory as an fe_inventory object
This fe_inventory object (fe_stand plots) was
built via the two-stage import chain
(import_standwise_relascope_format1_raw_to_pre +
import_standwise_relascope_pre_to_fe_inventory) from the
raw Silvarith-style example data shipped at
system.file("extdata", "data_ex6_standwise_raw", package = "FeNEU").
It has two fictitious stands and carries no plot coordinates, as is
typical for stand-wise inventories with angle-count
(relascopic, “Winkelzählprobe”) surveys.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Stand-Wise Inventory as an fe_inventory object
This fe_inventory object (fe_stand plots) was
built with import_standwise_relascope_pre_to_fe_inventory
from the pre-processed Silvarith-style example data shipped at
system.file("extdata", "data_ex7_standwise_pre", package = "FeNEU").
It has two fictitious stands and carries no plot coordinates, , as is
typical for stand-wise inventories with angle-count
(relascopic, “Winkelzählprobe”) surveys.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
FeNEU ships a set of small example inventories used throughout the
documentation, examples and tests. They are fully anonymised and artificial:
plot coordinates are randomised and all identifiers are re-assigned, so the
data carry no reference to any real forest enterprise and must not be used to
draw conclusions about one. The sets are named data_ex1_... to
data_ex7_.... The data represent three different processing stages, and the
inventory types currently supported by FeNEU.
An inventory passes through up to three stages in FeNEU, and each example is provided at whichever stages are useful for demonstration:
The unprocessed input tables as delivered by the field
recording software, before any standardisation. Bundled as text files
under system.file("extdata", ...), which is what the
*_raw_to_pre() functions read. For ex1 and ex2, the same tables are
additionally bundled as data/ tibbles (data_ex1_*, data_ex2_*) so
that they can be inspected without reading a file; the text files are
generated from those tibbles (data-raw/), so the two cannot drift
apart.
The intermediate, standardised form the
*_pre_to_fe_inventory() step consumes – BaySF-style tab-delimited text
files for the concentric sample type, or a canonical WZP_Daten.txt for
the stand-wise type. Bundled as folders under
system.file("extdata", ...).
The ready-to-analyse fe_inventory object, bundled
as a data/ object.
FeNEU supports sample and stand-wise inventories. Currently, we cover sample inventories that follow a concentric circle design, and stand-wise inventories with several angle-count samples per stand. In the overview table below, we refer to these types as sample, and standwise.
Sample-point inventory on concentric circles. Two raw input formats exist for sample inventories, "Format 1" and "Format 2"; both feed the same preprocessed BaySF-style form. Scope is counted in inventory points.
Stand-wise inventory in which
each stand is sampled with several relascope angle-count (Winkelzaehlprobe)
points. Currently, only one raw data format is supported for standwise
relascope inventories ("Format 1"); the raw and the preprocessed data
follow the Silvarith-style. Scope is counted in stands; in the resulting
object every angle-count point becomes one fe_stand row.
The raw formats of the sample inventories do not carry the geometry of the
concentric circles – it is part of the inventory design, not of the field
records. It therefore has to be passed to the *_raw_to_pre() functions,
through the arguments dbh_cm_from (the lower dbh threshold of each circle,
in cm) and radiuses_m (the matching radii, in m). Getting it wrong scales
the representation factors and hence every per-hectare figure, so the
designs of the two raw example sets are stated here:
| Set | dbh_cm_from |
radiuses_m |
resulting circle areas |
| ex1 | c(0, 12, 30, 48) |
c(2.82, 5.64, 11.28, 17.84) |
25 / 100 / 400 / 1000 m² |
| ex2 | c(0, 12, 30) |
c(2, 6.31, 12.62) |
12.6 / 125 / 500 m² |
These are the designs of the inventories the anonymised examples were derived from; use them when running the raw import of ex1 or ex2. The sets bundled from the preprocessed stage onwards (ex3 to ex5) carry their circle definition in the data and need no such argument.
| Set | Type | Stages bundled | Scope |
| ex1 | sample (concentric) | raw (Format 1) | 10 points |
| ex2 | sample (concentric) | raw (Format 2) | 10 points |
| ex3 | sample (concentric) | pre, fe_inventory (+ previous) | 10 points (previous 9) |
| ex4 | sample (concentric) | pre, fe_inventory (+ previous) | 100 points (previous 95) |
| ex5 | sample (concentric) | pre (simulated), fe_inventory (+ previous) | 10 points (previous 10) |
| ex6 | standwise (relascope) | raw (Format 1), pre, fe_inventory | 2 stands (17 points) |
| ex7 | standwise (relascope) | pre, fe_inventory | 2 stands (15 points) |
extdata folder data_ex1_sample_raw
(Baumschicht.txt, Inv_punkt.txt, Verjuengung.txt); objects
data_ex1_sample_raw_trees (133 rows), data_ex1_sample_raw_points
(10), data_ex1_sample_raw_smalltrees (43). Circle design:
dbh_cm_from = c(0, 12, 30, 48),
radiuses_m = c(2.82, 5.64, 11.28, 17.84). A dead-wood table exists for
developers only (deadwood import is deferred); it is not shipped with the
package.
extdata folder data_ex2_sample_raw
(02_probekreis.txt, 01_root_entity.txt); objects
data_ex2_sample_raw_trees (177 rows), data_ex2_sample_raw_points
(10). Circle design: dbh_cm_from = c(0, 12, 30),
radiuses_m = c(2, 6.31, 12.62). A small-tree and a dead-wood table are
not bundled yet (see note).
extdata folder data_ex3_sample_pre;
objects data_ex3_sample_fe_inventory and
data_ex3_previous_sample_fe_inventory (an earlier survey of the same
points, for increment estimation).
extdata folder data_ex4_sample_pre;
objects data_ex4_sample_fe_inventory and
data_ex4_previous_sample_fe_inventory. Same design as ex3, larger.
extdata folders
data_ex5_sample_pre and data_ex5_previous_sample_pre; objects
data_ex5_sample_fe_inventory and data_ex5_previous_sample_fe_inventory.
Carries permanent tree ids (tree_id_style = "generic").
extdata folders data_ex6_standwise_raw
and data_ex6_standwise_pre; object data_ex6_standwise_fe_inventory.
extdata folder data_ex7_standwise_pre;
object data_ex7_standwise_fe_inventory.
A few further bundled objects are derived from ex3 and kept under their
historical names; they are not part of the ex1–ex7 scheme and exist for
regression testing: inc_sub10_rep_classic, inc_sub10_rep_mean,
inc_sub10_rep_end, inc_sub10_rep_trans (increment reference results),
processed_pulled_sub10, processed_heights_nfi_sub10 and
processed_heights_bav_sub10 (intermediate tree-preparation results).
ex2 currently provides only the tree and inventory-point tables. A Format-2 dead-wood table (the "07" sheet) and a regeneration table are not bundled yet; they can be added later.
Besides the raw -> pre -> fe_inventory chain, FeNEU offers a separate strand
that produces a stand register (Revierbuch) from the inventory input
data. It needs stand-level attributes that an fe_inventory object does not
carry. For stand-wise inventories these are read from a metadata file with
import_standwise_relascope_format1_metadata();
import_standwise_relascope_format1_stand_register_bundle() orchestrates
trees and metadata for stand_register_pdf(). Set ex6 bundles such a
metadata file (stand_metadata.txt) as an example; the three processing
stages above never touch it.
The exported import functions that move an inventory between the stages illustrated by these example data:
raw to pre: import_sample_concentric_format1_raw_to_pre(),
import_sample_concentric_format2_raw_to_pre(),
import_standwise_relascope_format1_raw_to_pre()
pre to fe_inventory: import_sample_concentric_pre_to_fe_inventory(),
import_standwise_relascope_pre_to_fe_inventory()
the inventory-type-agnostic dispatcher for the pre to fe_inventory step:
read_and_convert_data()
the object constructor itself: fe_inventory()
the stand register strand:
import_standwise_relascope_format1_metadata(),
import_standwise_relascope_format1_stand_register_bundle(),
stand_register_pdf()
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Checks whether the tools required for rendering PDF reports (pandoc and a LaTeX distribution) are available on the current system, and prints a message for each missing component explaining how to install it.
diagnose_pdf_toolchain()diagnose_pdf_toolchain()
Invisibly, a named logical list with elements pandoc and
latex.
diagnose_pdf_toolchain()diagnose_pdf_toolchain()
Standard Construction of an fe_inventory Object
fe_inventory( inventory_list, object_type = c("fe_stand", "fe_stand_spatial", "fe_ccircle_spatial") )fe_inventory( inventory_list, object_type = c("fe_stand", "fe_stand_spatial", "fe_ccircle_spatial") )
inventory_list |
A tibble with the inventory data containing the necessary three columns with plot_id, the plot objects, and the inv_rep_area |
object_type |
Character to define what type of objects will be save
as inventory points: |
If the information provided allows to construct a valid
fe_inventory object, this object will be returned. The function will
terminate with an error otherwise
# fe_inventory() is the constructor at the end of the import pipeline. It # is normally reached through the public entry point read_and_convert_data(), # which builds the intermediate inventory list and calls fe_inventory() # internally. in_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") read_and_convert_data(in_path, inventory_type = "sample_concentric", coord_sys = "gk4")# fe_inventory() is the constructor at the end of the import pipeline. It # is normally reached through the public entry point read_and_convert_data(), # which builds the intermediate inventory list and calls fe_inventory() # internally. in_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") read_and_convert_data(in_path, inventory_type = "sample_concentric", coord_sys = "gk4")
This procedure can be time consuming with large inventories, therefore
parallel processing is used (see parameter free_cores).
fill_heights_back( inv_dat, pulled_est_height, small_trees = FALSE, .progress = TRUE, free_cores = 4 )fill_heights_back( inv_dat, pulled_est_height, small_trees = FALSE, .progress = TRUE, free_cores = 4 )
inv_dat |
Object of class |
pulled_est_height |
tibble which was pulled from an |
small_trees |
|
.progress |
Logical, if |
free_cores |
Integer, indicating the number of processor cores which
will not be assigned to parallel processing tasks. If |
The input fe_inventory object with updated heights
# Estimate heights - only the pulled tree tibble is affected so far suppressWarnings( # Warnings come from an intentional species code casts - no problem here inventory_est_heights <- data_ex3_sample_fe_inventory |> pull_trees() |> height_complete_inventory(method = "NFI") ) # Now write the heights back into the original object or, as in this case, # an otherwise identical copy of it peg_fe_inventory_updated <- fill_heights_back( data_ex3_sample_fe_inventory, inventory_est_heights )# Estimate heights - only the pulled tree tibble is affected so far suppressWarnings( # Warnings come from an intentional species code casts - no problem here inventory_est_heights <- data_ex3_sample_fe_inventory |> pull_trees() |> height_complete_inventory(method = "NFI") ) # Now write the heights back into the original object or, as in this case, # an otherwise identical copy of it peg_fe_inventory_updated <- fill_heights_back( data_ex3_sample_fe_inventory, inventory_est_heights )
Writes an fe_ikl-keyed circle-definition file (default
Probekreisdefinition.txt) for the concentric sample import chain
(import_sample_concentric_format1_raw_to_pre,
import_sample_concentric_format2_raw_to_pre). The concentric
importers require a circle definition; when a ready-made one is not at hand,
this helper produces a uniform definition – the same set of
concentric circles for every plot – written as a single
fe_ikl = "ALL" group. (For multiple circle classes, write the file
yourself with one integer fe_ikl per class and link each inventory
point to its class via its own fe_ikl column.)
generate_circle_definition( output_dir, dbh_cm_from, radiuses_m, filename = "Probekreisdefinition" )generate_circle_definition( output_dir, dbh_cm_from, radiuses_m, filename = "Probekreisdefinition" )
output_dir |
Folder the file is written to (character). Created if it does not exist. |
dbh_cm_from |
Numeric vector of lower DBH limits in cm, one per
concentric circle (e.g. |
radiuses_m |
Numeric vector of circle radii in m, the same
length as |
filename |
Base file name with or without the |
There is deliberately no default geometry: the caller must supply
dbh_cm_from and radiuses_m, because the evaluation results
depend directly on the circle sizes. These parameter names match those of the
concentric raw importers.
The path of the written file (invisibly).
import_sample_concentric_format1_raw_to_pre,
import_sample_concentric_format2_raw_to_pre
dir <- tempdir() generate_circle_definition( dir, dbh_cm_from = c(0, 12, 30), radiuses_m = c(2.82, 5.64, 12.62) )dir <- tempdir() generate_circle_definition( dir, dbh_cm_from = c(0, 12, 30), radiuses_m = c(2.82, 5.64, 12.62) )
Returns the unique survey year (time_yr) of an inventory object.
At present a method is provided for fe_inventory, where
uniformity of time_yr across all plots is guaranteed by the
fe_inventory constructor; the method does a defensive check
regardless.
get_inv_year(x, ...) ## S3 method for class 'fe_inventory' get_inv_year(x, ...)get_inv_year(x, ...) ## S3 method for class 'fe_inventory' get_inv_year(x, ...)
x |
An inventory object. |
... |
Currently unused, reserved for method-specific extensions. |
A single numeric value: the survey year.
get_inv_year(data_ex3_sample_fe_inventory)get_inv_year(data_ex3_sample_fe_inventory)
For matched plot pairs from two subsequent inventories, this function ensures
that the slope values in the first inventory's circle definitions match
those of the second inventory. This is important because differing slope
assessments lead to different n_rep_ha values for the same tree in
the same concentric circle, which can distort increment calculations and
cause false circle-transition detections.
harmonize_inv_for_repsurv(inv_1st, inv_2nd, plot_matches)harmonize_inv_for_repsurv(inv_1st, inv_2nd, plot_matches)
inv_1st |
An object of class |
inv_2nd |
An object of class |
plot_matches |
Output of |
The function modifies the circle_definition$slope of matched plots in
inv_1st to the value found in the corresponding plot of
inv_2nd. Missing (NA) slopes are treated as 0 (flat terrain).
Plots where neither circle definition contains a slope column are
skipped, as are plots with empty circle definitions (notrees plots).
After the slope correction, n_rep_ha is recalculated for affected
trees using n_rep_ha, and the modified plot
objects are revalidated with
validate_fe_ccircle_spatial.
After harmonization, the user should re-derive the tree data from the
returned inventory object (e.g. via pull_trees |>
height_complete_inventory |> trees_add_essentials).
A modified copy of inv_1st where the slope values in
matched plots have been set to the corresponding values from
inv_2nd and n_rep_ha has been recalculated accordingly.
Unmatched plots are returned unchanged.
Other increment:
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory plot_matches <- match_2_inventories( inv_a, inv_b, match_type = "plot_id", "baysf" ) inv_a_harmonized <- harmonize_inv_for_repsurv(inv_a, inv_b, plot_matches)inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory plot_matches <- match_2_inventories( inv_a, inv_b, match_type = "plot_id", "baysf" ) inv_a_harmonized <- harmonize_inv_for_repsurv(inv_a, inv_b, plot_matches)
Typically in an inventory, height measurements are done only for a part of the sampled trees. This function provides reasonable estimates for the missing heights.
height_complete_inventory( pulled_inventory, d_q_interval = 5, method = c("NFI", "Bavaria"), diagnostic = FALSE )height_complete_inventory( pulled_inventory, d_q_interval = 5, method = c("NFI", "Bavaria"), diagnostic = FALSE )
pulled_inventory |
Tibble with tree list for the whole inventory,
typically the output of |
d_q_interval |
Integer indicating the interval breaks for the dq (quadratic mean diameter) classes to be formed. Default is 5-cm-classes, where all dq values over 60 cm are all put into the same class. |
method |
Height estimation method for trees with missing heights, "NFI" height curves are defined as default, alternatively "Bavaria" can be selected, but in this case an age must be provided for every tree (see Details) |
diagnostic |
Logical, if TRUE, the function provides diagnostic output, which is NOT compatible with the standard output and its usage. Default is FALSE. Use TRUE only, if you know exactly what you are doing. |
The function first identifies quadratic mean diameter (dq) classes grouped by
species group (i.e. fe_species_tum_wwk_short),
and stand layer level for each plot. These classes are then applied to the
whole inventory (i.e. omitting the grouping by plot), to calculate a dq
value for each dq class, species group, and stand layer. From the
height-measured trees a corresponding hq (quadratic mean height) is
calculated. In case there are no height measured trees in a group, so that
there is no data-based estimate of hq possible the function
h_q_from_d_q is used as a fallback. In this
case a warning is issued.
Both, hq and dq are the entry points for the subsequent individual tree
height estimates which are based on the individual trees' dbh. Note that for
the height estimation method "Bavaria" also an age must be given for each
tree (usually the stand or stand layer age).
The estimation methods "NFI", and "Bavaria" use the standard height curve
systems h_standard_gnfi3, and
h_standard_bv, respectively.
A tibble in the same format as the input pulled_inventory,
but with the additional columns h_est_m, i.e. height estimates for
every tree, species_group, d_q_cm, and h_q_m.
# Pull tree data from an fe_inventory object pulled_inventory <- data_ex3_sample_fe_inventory |> pull_trees() # Use the NFI method. The h_q fallback warning is expected here where a # species x layer group has no measured height. suppressWarnings( height_complete_inventory(pulled_inventory, method = "NFI") ) # ... and the Bavaria method on the same data suppressWarnings( height_complete_inventory(pulled_inventory, method = "Bavaria") )# Pull tree data from an fe_inventory object pulled_inventory <- data_ex3_sample_fe_inventory |> pull_trees() # Use the NFI method. The h_q fallback warning is expected here where a # species x layer group has no measured height. suppressWarnings( height_complete_inventory(pulled_inventory, method = "NFI") ) # ... and the Bavaria method on the same data suppressWarnings( height_complete_inventory(pulled_inventory, method = "Bavaria") )
Reads format 1 raw sample inventory data collected with the concentric-circle
method and writes the five standard BaySF-style intermediate files
(fdinvbhd.txt, fdinvba.txt, fdinvkrs.txt,
fcbestku.txt, fdvikrs.txt) into output_dir.
import_sample_concentric_format1_raw_to_pre( input_path, output_dir, treelist_filename = "Baumschicht.txt", inv_punkt_filename = "Inv_punkt.txt", small_trees_filename = NULL, circle_def_filename = NULL, species_guess = FALSE, dbh_cm_from = NULL, radiuses_m = NULL, coord_sys = NULL, inventory_year = NULL, encoding = "auto" )import_sample_concentric_format1_raw_to_pre( input_path, output_dir, treelist_filename = "Baumschicht.txt", inv_punkt_filename = "Inv_punkt.txt", small_trees_filename = NULL, circle_def_filename = NULL, species_guess = FALSE, dbh_cm_from = NULL, radiuses_m = NULL, coord_sys = NULL, inventory_year = NULL, encoding = "auto" )
input_path |
Path to the folder holding the source files (character). |
output_dir |
Folder the preprocessed BaySF-style files are written to (character, required). There is deliberately no default: the function writes files, and a default would write into the folder the raw data came from, i.e. into the user's own filespace. Created if it does not exist. Untouched if validation fails. Should the plot ids of the tree list and the inventory-point file not match,
two diagnostic files listing the offending plots are written here as well:
|
treelist_filename |
Name of the tree-list file (with or without the
Required columns (German alias in parentheses):
Optional columns:
Any further columns are ignored – extra columns do not disturb the import, they are simply not used. As FeNEU develops, more columns may become supported (this applies to all raw import formats). |
inv_punkt_filename |
Name of the inventory-point file (with or without the
Required columns (German alias in parentheses):
Optional columns:
Further columns are ignored (they do not disturb the import). |
small_trees_filename |
Name of the small-tree file (with or without the
Optional columns:
Any further columns are ignored (they do not disturb the import). |
circle_def_filename |
Name of the circle-definition file (with or
without the |
species_guess |
Logical. If This is a stopgap for real-world data whose species column holds
text abbreviations instead of codes. We strongly recommend
supplying the proper numeric BaySF species codes ( |
dbh_cm_from |
Numeric vector of lower DBH limits in cm for each
concentric circle, or |
radiuses_m |
Numeric vector of circle radii in m, or |
coord_sys |
Coordinate reference system of The system is never guessed: if neither the column nor this argument states it, the import fails and says so; if both do and they disagree, it fails and names both; and if the declaration contradicts the magnitude of the coordinates (geographic values declared as projected or vice versa), it fails with a concrete suggestion. The preprocessed |
inventory_year |
Optional single survey year (e.g. Downstream only the year is kept (each plot object carries a single
|
encoding |
Character encoding of the source |
Column names in the source files are case-insensitive (converted to lower case internally). Both English canonical names and their German equivalents are accepted; the German alias is silently renamed to the English canonical before validation.
In its raw encoding, Format 1 records measurements in familiar units (DBH in
cm, height in m), the tree position as a single azimuth angle (degrees)
plus a distance (m), the stand layer directly as BaySF layer codes, and
both living and dead trees. Format 2 encodes the same information differently
(DBH in mm, a gon-or-degree back azimuth with a unit flag, its own layer code,
living trees only); see
import_sample_concentric_format2_raw_to_pre.
Stand age. Age in forest inventories always refers to the stand or stand layer, never to the individual tree, even though it is recorded redundantly in every tree row. It is optional: in structure-rich, uneven-aged stands – increasingly important in practice – a meaningful stand age often cannot be given. When the age is missing or incomplete, the analyses that group by age class are unavailable: base tables and structure tables by age class, and the age-class breakdown of increment from a repeated inventory – all of these can be run by mean-diameter (dq) class instead. Increment from yield tables and from the BWI3 (gnfi3) functions requires the age and is not possible without it. A warning is issued on import whenever the age is absent or has gaps, so an accidental omission can be noticed and corrected; users whose forest structure genuinely precludes a stand age can ignore it.
No height completion is performed here. Measured tree heights are carried
through as given (missing heights stay NA); the converter only records
which heights were measured (internal hmb flag) and normalises their
unit where the raw format requires it. Estimating the missing heights is a
deliberate, separate downstream step –
pull_trees() |> height_complete_inventory() |> fill_heights_back() –
so that measured and estimated heights are never silently mixed.
A named list (the common raw-to-pre report): ok (logical),
errors (character), warnings (character), paths
(the written files, or NULL if !ok), species_mapping
and needs_review. On success it writes fdinvbhd.txt,
fdinvba.txt, fdinvkrs.txt, fcbestku.txt, and
fdvikrs.txt into output_dir.
When species_guess = TRUE, species_mapping is a tibble with
one row per raw species abbreviation (raw, n_trees,
canonical, species_id, name_ger, tier). A
tier of "confirmed" means an exact or case-insensitive match;
"review" means the code was resolved only by substring / fuzzy /
mojibake matching and is worth a manual check. needs_review is
TRUE whenever any row is "review" (with a matching warning);
both are NULL/FALSE when species_guess = FALSE.
FeNEU currently supports two raw data formats for sample inventories with
concentric circles. The two grew up in parallel with FeNEU itself and have no
fundamental differences in content – they simply reflect different user
preferences for how the data are exported. We call them “Format 1” and
“Format 2”. This function reads Format 1; Format 2 is read by
import_sample_concentric_format2_raw_to_pre. Both produce the
same BaySF-style preprocessed files, so everything downstream is identical.
# Use example raw input data shipped with the package # and write them to a temporary folder. td <- tempdir() # Write example tables under the recommended Format-1 file names readr::write_delim( data_ex1_sample_raw_trees, file = file.path(td, "Baumschicht.txt"), delim = "\t" ) readr::write_delim( data_ex1_sample_raw_points, file = file.path(td, "Inv_punkt.txt"), delim = "\t" ) readr::write_delim( data_ex1_sample_raw_smalltrees, file = file.path(td, "Verjuengung.txt"), delim = "\t" ) # Definition of concentric sample circles dbh_cm_from <- c(0, 12, 30, 48) radiuses_m <- c(2.82, 5.64, 11.28, 17.84) # Create BaySF-style intermediate files in a separate temporary folder # (function is called for its side effects). output_dir is mandatory -- # the converter never picks a target folder itself. out_dir <- file.path(tempdir(), "pre_ex1") import_sample_concentric_format1_raw_to_pre( input_path = td, output_dir = out_dir, treelist_filename = "Baumschicht", inv_punkt_filename = "Inv_punkt", small_trees_filename = "Verjuengung", species_guess = TRUE, dbh_cm_from = dbh_cm_from, radiuses_m = radiuses_m, coord_sys = "gk4" ) # Check that one of the output files was created file.exists(file.path(out_dir, "fdinvbhd.txt"))# Use example raw input data shipped with the package # and write them to a temporary folder. td <- tempdir() # Write example tables under the recommended Format-1 file names readr::write_delim( data_ex1_sample_raw_trees, file = file.path(td, "Baumschicht.txt"), delim = "\t" ) readr::write_delim( data_ex1_sample_raw_points, file = file.path(td, "Inv_punkt.txt"), delim = "\t" ) readr::write_delim( data_ex1_sample_raw_smalltrees, file = file.path(td, "Verjuengung.txt"), delim = "\t" ) # Definition of concentric sample circles dbh_cm_from <- c(0, 12, 30, 48) radiuses_m <- c(2.82, 5.64, 11.28, 17.84) # Create BaySF-style intermediate files in a separate temporary folder # (function is called for its side effects). output_dir is mandatory -- # the converter never picks a target folder itself. out_dir <- file.path(tempdir(), "pre_ex1") import_sample_concentric_format1_raw_to_pre( input_path = td, output_dir = out_dir, treelist_filename = "Baumschicht", inv_punkt_filename = "Inv_punkt", small_trees_filename = "Verjuengung", species_guess = TRUE, dbh_cm_from = dbh_cm_from, radiuses_m = radiuses_m, coord_sys = "gk4" ) # Check that one of the output files was created file.exists(file.path(out_dir, "fdinvbhd.txt"))
Reads format 2 raw sample inventory data collected with the concentric circle
method and writes the standard preprocessed BaySF-style intermediate files
(fdinvbhd.txt, fdinvba.txt, fdinvkrs.txt,
fcbestku.txt, fdvikrs.txt) into output_dir.
import_sample_concentric_format2_raw_to_pre( input_path, output_dir, treelist_filename = "02_probekreis.txt", inv_punkt_filename = "01_root_entity.txt", circle_def_filename = NULL, species_guess = FALSE, dbh_cm_from = NULL, radiuses_m = NULL, coord_sys = NULL, inventory_year = NULL, encoding = "auto" )import_sample_concentric_format2_raw_to_pre( input_path, output_dir, treelist_filename = "02_probekreis.txt", inv_punkt_filename = "01_root_entity.txt", circle_def_filename = NULL, species_guess = FALSE, dbh_cm_from = NULL, radiuses_m = NULL, coord_sys = NULL, inventory_year = NULL, encoding = "auto" )
input_path |
Path to the folder holding the source files (character). |
output_dir |
Folder the preprocessed BaySF-style files are written to (character, required). There is deliberately no default: the function writes files, and a default would write into the folder the raw data came from, i.e. into the user's own filespace. Created if it does not exist. Untouched if validation fails. |
treelist_filename |
Name of the tree-list file (Format 2 source table 02,
with or without the Required columns:
Optional columns:
Any further columns are ignored – extra columns do not disturb the import. Format 2 records only living trees (no mortality column); mortality is set to 0 for every record. |
inv_punkt_filename |
Name of the inventory-point file (Format 2 source
table 01, with or without the Required columns:
Optional columns:
Any further columns are ignored – extra columns do not disturb the import. |
circle_def_filename |
Name of the circle-definition file (with or
without the In practice Format 2 runs uniform: its source tables carry no
circle-class key (the inventory-point table has no |
species_guess |
Logical. Currently unused; reserved for future
species-guessing support. Default is |
dbh_cm_from |
Numeric vector of lower DBH limits (cm) for each concentric
circle, or |
radiuses_m |
Numeric vector of circle radii (m), or |
coord_sys |
Coordinate reference system of the plot-centre coordinates,
or The native Format-2 export stores geographic coordinates and
declares them ( The preprocessed |
inventory_year |
Optional single survey year (e.g. Downstream only the year is kept (each plot object carries a single
|
encoding |
Character encoding of the source |
Format 2 defines nine source tables in total. This converter
currently supports only the narrow core – two tables: the main tree list
(02) and the inventory-point / coordinate table (01). Importers for the
remaining tables are under construction: the tree-property data
(03), regeneration incl. height classes (04-06, 08), and dead wood (07, 09)
are not read yet. In particular, Format 2 has its own dedicated
small-tree / regeneration format, for which a reader will be added in the
future; until then no regeneration / small-tree records are produced, so this
converter never yields the bhd == 0 tally rows that the BaySF-style
pre-reader would otherwise split off into small trees.
In its raw encoding, Format 2 records DBH in mm and heights in dm, the tree
position as a back azimuth given in gon or degrees (disambiguated by a unit
flag) plus a distance in cm, its own stand-layer code (remapped to BaySF
codes, see above), and living trees only. Format 1 encodes the same
information differently (cm and m, a single degree azimuth, BaySF layer codes
directly, living and dead trees); see
import_sample_concentric_format1_raw_to_pre.
Stand age. Age in forest inventories always refers to the stand or stand layer, never to the individual tree, even though it is recorded redundantly in every tree row. It is optional: in structure-rich, uneven-aged stands – increasingly important in practice – a meaningful stand age often cannot be given. When the age is missing or incomplete, the analyses that group by age class are unavailable: base tables and structure tables by age class, and the age-class breakdown of increment from a repeated inventory – all of these can be run by mean-diameter (dq) class instead. Increment from yield tables and from the BWI3 (gnfi3) functions requires the age and is not possible without it. A warning is issued on import whenever the age is absent or has gaps, so an accidental omission can be noticed and corrected; users whose forest structure genuinely precludes a stand age can ignore it.
No height completion is performed here. Measured tree heights are carried
through as given (missing heights stay NA); the converter only records
which heights were measured (internal hmb flag) and normalises their
unit where the raw format requires it (Format 2 stores heights in dm).
Estimating the missing heights is a deliberate, separate downstream step –
pull_trees() |> height_complete_inventory() |> fill_heights_back() –
so that measured and estimated heights are never silently mixed.
A named list (the common raw-to-pre report): ok (logical),
errors (character), warnings (character), and paths
(the written files, or NULL if !ok). On success it writes
fdinvbhd.txt, fdinvba.txt, fdinvkrs.txt,
fcbestku.txt, and fdvikrs.txt into output_dir.
FeNEU currently supports two raw data formats for sample inventories with
concentric circles. The two grew up in parallel with FeNEU itself and have no
fundamental differences in content – they simply reflect different user
preferences for how the data are exported. We call them “Format 1” and
“Format 2”. This function reads Format 2; Format 1 is read by
import_sample_concentric_format1_raw_to_pre. Both produce the
same BaySF-style preprocessed files, so everything downstream is identical.
bestku)Format 2 codes the stand layer in the tree-list column bestku
differently from the BaySF-style pre format and from Format 1. The
converter therefore remaps the Format-2 codes
onto the BaySF layer codes that the rest of the pipeline (the fcbestku
table and the internal layer_key) expects:
Format 2 (bestku) |
-> | BaySF code |
| 1 Hauptschicht | -> | 1 Oberschicht (main stand) |
| 2 Zwischenschicht | -> | 2 Unterstand |
| 3 Unterschicht | -> | 2 Unterstand |
| 4 Vorausverjuengung | -> | 3 Vorausverjuengung |
| 5 Ueberhaelter/Nachhiebsrest | -> | 5 Ueberhaelter |
Note in particular that the same number means different things in the two
codings (e.g. Format-2 bestku = 4 is advance regeneration, whereas
BaySF/Format-1 code 4 is residual stand). The main stand (code 1) is
identical in both. Format 2's two sub-canopy layers (Zwischenschicht,
Unterschicht) are both mapped to the single BaySF Unterstand, and Format 2's
combined Ueberhaelter/Nachhiebsrest maps to Ueberhaelter.
# Use example raw input data shipped with the package # and write them to a temporary folder under the default # file names, so the converter can be called with its defaults. td <- tempdir() readr::write_delim( data_ex2_sample_raw_trees, file = file.path(td, "02_probekreis.txt"), delim = "\t" ) readr::write_delim( data_ex2_sample_raw_points, file = file.path(td, "01_root_entity.txt"), delim = "\t" ) # Definition of concentric sample circles dbh_cm_from <- c(0, 12, 30) radiuses_m <- c(2., 6.31, 12.62) # Create BaySF-style intermediate files in a separate temporary folder # (function is called for its side effects; the file names default to the # format's standard names "02_probekreis.txt" / "01_root_entity.txt"). # output_dir is mandatory -- the converter never picks a target itself. # The example points carry their own srs (EPSG:4326), so no coord_sys is # needed; inventory_year is passed because the native date_created is the # ambiguous DD-MM-YY. out_dir <- file.path(tempdir(), "pre_ex2") import_sample_concentric_format2_raw_to_pre( input_path = td, output_dir = out_dir, dbh_cm_from = dbh_cm_from, radiuses_m = radiuses_m, inventory_year = 2025 ) # Check that one of the output files was created file.exists(file.path(out_dir, "fdinvbhd.txt"))# Use example raw input data shipped with the package # and write them to a temporary folder under the default # file names, so the converter can be called with its defaults. td <- tempdir() readr::write_delim( data_ex2_sample_raw_trees, file = file.path(td, "02_probekreis.txt"), delim = "\t" ) readr::write_delim( data_ex2_sample_raw_points, file = file.path(td, "01_root_entity.txt"), delim = "\t" ) # Definition of concentric sample circles dbh_cm_from <- c(0, 12, 30) radiuses_m <- c(2., 6.31, 12.62) # Create BaySF-style intermediate files in a separate temporary folder # (function is called for its side effects; the file names default to the # format's standard names "02_probekreis.txt" / "01_root_entity.txt"). # output_dir is mandatory -- the converter never picks a target itself. # The example points carry their own srs (EPSG:4326), so no coord_sys is # needed; inventory_year is passed because the native date_created is the # ambiguous DD-MM-YY. out_dir <- file.path(tempdir(), "pre_ex2") import_sample_concentric_format2_raw_to_pre( input_path = td, output_dir = out_dir, dbh_cm_from = dbh_cm_from, radiuses_m = radiuses_m, inventory_year = 2025 ) # Check that one of the output files was created file.exists(file.path(out_dir, "fdinvbhd.txt"))
The pre-to-fe_inventory step of the concentric sample import chain. Reads a
folder of preprocessed BaySF-style files (fdinvbhd.txt,
fdinvba.txt, fdinvkrs.txt, fcbestku.txt,
fdvikrs.txt) – produced by
import_sample_concentric_format1_raw_to_pre /
import_sample_concentric_format2_raw_to_pre, or supplied
directly in that shape – and builds an fe_inventory of
fe_ccircle_spatial plots.
import_sample_concentric_pre_to_fe_inventory( input_path, style = "baysf", coord_sys = NULL, check_envelope = TRUE, encoding = "auto" )import_sample_concentric_pre_to_fe_inventory( input_path, style = "baysf", coord_sys = NULL, check_envelope = TRUE, encoding = "auto" )
input_path |
Folder holding the preprocessed BaySF-style files (character). |
style |
Format family of the preprocessed data. Currently only
|
coord_sys |
Coordinate reference system of the plot coordinates; see
Geographic coordinates ( State |
check_envelope |
Logical, default |
encoding |
Character encoding of the preprocessed |
Counterpart to import_standwise_relascope_pre_to_fe_inventory.
Building the inventory objects can take a while for large forest units
(thousands of plots). Progress is reported through the progressr
framework, one step per plot. By default nothing is shown; wrap the call to
see a progress bar, and the same code drives a native Shiny progress bar
inside shiny::withProgress() / progressr::withProgressShiny():
progressr::handlers("cli")
progressr::with_progress(
inv <- import_sample_concentric_pre_to_fe_inventory(input_path)
)
No height completion is performed here either: the returned inventory carries
the measured heights as they are (missing ones stay NA). Estimating
them is a deliberate, separate downstream step –
pull_trees() |> height_complete_inventory() |> fill_heights_back().
An fe_inventory of fe_ccircle_spatial plots.
The plot-centre coordinate columns are named gauss_rw/gauss_hw
(Gauss-Krueger Rechtswert / Hochwert) for historical reasons, but
modern BaySF exports store UTM32 (ETRS89 / UTM zone 32N) values in
them – the “gauss” name is a legacy label, not a statement about the
CRS (native files even carry a GAUSS_KZ zone field that no longer
reflects the actual system). FeNEU therefore never infers the CRS from the
column name: pre files it writes itself record the real CRS in a
coord_sys column (self-describing, so no argument is needed here),
while a genuine BaySF export has no such column and you must pass
coord_sys explicitly – for current data that is almost always
"utm32".
import_sample_concentric_format1_raw_to_pre,
read_and_convert_data
# The bundled example pre carries a coord_sys column (utm32), so it is # self-describing and needs no coord_sys argument. inv_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") inv <- import_sample_concentric_pre_to_fe_inventory(inv_path) inv# The bundled example pre carries a coord_sys column (utm32), so it is # self-describing and needs no coord_sys argument. inv_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") inv <- import_sample_concentric_pre_to_fe_inventory(inv_path) inv
The raw-to-pre step of the stand-wise relascope
(“Winkelzählprobe” / angle-count) import chain. Reads a
Silvarith-style raw tree file (EingabedatenGesamt.txt: German locale
– decimal comma, umlaut headers, DD.MM.YYYY dates), validates it
(collecting every problem rather than stopping at the first), and –
if valid – writes the preprocessed WZP_Daten.txt (the canonical
ASCII / decimal-point form) that
import_standwise_relascope_pre_to_fe_inventory reads.
import_standwise_relascope_format1_raw_to_pre( input_path, output_dir, treelist_filename = "EingabedatenGesamt.txt", encoding = "auto" )import_standwise_relascope_format1_raw_to_pre( input_path, output_dir, treelist_filename = "EingabedatenGesamt.txt", encoding = "auto" )
input_path |
Folder holding the raw file (character). |
output_dir |
Folder the preprocessed |
treelist_filename |
Raw file name, with or without the |
encoding |
Character encoding of the source file. Default |
This is the direct counterpart to
import_sample_concentric_format1_raw_to_pre for concentric
sample inventories: a single top-level converter that performs its own
validation (“plausi”) internally and returns a collected report. There
is no separately exported plausi function.
“Silvarith-style” describes the shape of the data. Silvarith is
a stand-wise angle-count software; this importer targets its export layout
without claiming exact or official compatibility. A user who already holds a
WZP_Daten.txt – Silvarith also produces one directly, or it was made
earlier by this function – skips this step and goes straight to
import_standwise_relascope_pre_to_fe_inventory.
Required columns (after tolower() of the header):
Plot number within the stand (integer).
Sequential record number within the plot; renamed to
lfd_nr.
Stand identifier (character).
Stand area in ha (decimal comma); renamed to
bestflaeche.
Angle-count factor; renamed to zaehlfaktor.
Species code in BaySF coding; renamed to baumart.
Age in years (integer).
Silvarith layer code in {0, 1, 2, 3}: 0 = main stand
(Hauptschicht), 1 = harvest remnants (Nachhiebsreste), 2 = veterans
(Ueberhaelter) – 1 and 2 both fall into the remnant/veteran layer –
3 = understorey (Unter-/Zwischenschicht). Mapped to fe_stand
layer_key in
import_standwise_relascope_pre_to_fe_inventory; Silvarith
has no code for advance regeneration.
Tree count for this record; renamed to anzahl.
DBH in cm (decimal comma).
Height in m (decimal comma); renamed to hoehe.
Survey date in DD.MM.YYYY format.
Collected checks: bhd non-negative; schicht in
{0, 1, 2, 3}; stichtag parseable as %d.%m.%Y;
hoehe > 50 m raises a (non-blocking) warning.
No height completion is performed here, and missing heights are not rejected:
measured tree heights are carried through as given (missing ones stay
NA). Estimating the missing heights is a deliberate, separate
downstream step –
pull_trees() |> height_complete_inventory() |> fill_heights_back() –
so that measured and estimated heights are never silently mixed. (Angle-count
surveys usually measure a height for every tallied tree, so missing heights
are uncommon here, but they are tolerated.)
A named list (the common raw-to-pre report):
Logical. TRUE if the file passed validation and was
written.
Character vector of validation problems; empty if ok.
Character vector of non-blocking notices; may be non-empty
even when ok.
Character vector of written files, or NULL if
!ok.
import_standwise_relascope_pre_to_fe_inventory,
import_sample_concentric_format1_raw_to_pre
# The bundled example uses the canonical Silvarith export name # "EingabedatenGesamt.txt" (the default of `treelist_filename`). sil_dir <- system.file("extdata", "data_ex6_standwise_raw", package = "FeNEU") out_dir <- tempdir() result <- import_standwise_relascope_format1_raw_to_pre( sil_dir, output_dir = out_dir ) result$ok result$paths# The bundled example uses the canonical Silvarith export name # "EingabedatenGesamt.txt" (the default of `treelist_filename`). sil_dir <- system.file("extdata", "data_ex6_standwise_raw", package = "FeNEU") out_dir <- tempdir() result <- import_standwise_relascope_format1_raw_to_pre( sil_dir, output_dir = out_dir ) result$ok result$paths
The pre-to-fe_inventory step of the stand-wise relascope
(“Winkelzählprobe” / angle-count) import chain. Reads the preprocessed
WZP_Daten.txt – produced by
import_standwise_relascope_format1_raw_to_pre, or a
Silvarith-style WZP_Daten.txt supplied directly – and builds an
fe_inventory of fe_stand plots.
import_standwise_relascope_pre_to_fe_inventory( input_path, style = "silvarith", encoding = "auto" )import_standwise_relascope_pre_to_fe_inventory( input_path, style = "silvarith", encoding = "auto" )
input_path |
Folder holding the preprocessed |
style |
Format family of the preprocessed data. Currently only
|
encoding |
Character encoding of the preprocessed |
Counterpart to import_sample_concentric_pre_to_fe_inventory.
Building the inventory objects can take a while for large forest units
(thousands of plots). Progress is reported through the progressr
framework, one step per plot. By default nothing is shown; wrap the call to
see a progress bar, and the same code drives a native Shiny progress bar
inside shiny::withProgress() / progressr::withProgressShiny():
progressr::handlers("cli")
progressr::with_progress(
inv <- import_standwise_relascope_pre_to_fe_inventory(input_path)
)
No height completion is performed here either, and missing heights are not
rejected: the returned inventory carries the measured heights as they are
(missing ones stay NA). Estimating them is a deliberate, separate
downstream step –
pull_trees() |> height_complete_inventory() |> fill_heights_back().
An fe_inventory of fe_stand plots.
import_standwise_relascope_format1_raw_to_pre,
read_and_convert_data
# Build a preprocessed WZP_Daten.txt from the bundled Silvarith-style example, # then read it into an fe_inventory. sil_dir <- system.file("extdata", "data_ex6_standwise_raw", package = "FeNEU") out_dir <- tempdir() import_standwise_relascope_format1_raw_to_pre(sil_dir, output_dir = out_dir) inv <- import_standwise_relascope_pre_to_fe_inventory(out_dir) inv# Build a preprocessed WZP_Daten.txt from the bundled Silvarith-style example, # then read it into an fe_inventory. sil_dir <- system.file("extdata", "data_ex6_standwise_raw", package = "FeNEU") out_dir <- tempdir() import_standwise_relascope_format1_raw_to_pre(sil_dir, output_dir = out_dir) inv <- import_standwise_relascope_pre_to_fe_inventory(out_dir) inv
Reference Tree Increment Data for Automated Tests (sub_10, rep_classic)
Provided for automated testing. Contains the tree_increments
tibble produced by inv_increment_repsurv_ccirc with method
"rep_classic", applied to data_ex3_previous_sample_fe_inventory
(first survey) and data_ex3_sample_fe_inventory (second
survey), with match_type = "plot_id" and plot_id_style = "baysf".
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Reference Tree Increment Data for Automated Tests (sub_10, rep_end)
Provided for automated testing. Contains the tree_increments
tibble produced by inv_increment_repsurv_ccirc with method
"rep_end". See inc_sub10_rep_classic for details on
the input data.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Reference Tree Increment Data for Automated Tests (sub_10, rep_mean)
Provided for automated testing. Contains the tree_increments
tibble produced by inv_increment_repsurv_ccirc with method
"rep_mean". See inc_sub10_rep_classic for details on
the input data.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Reference Tree Increment Data for Automated Tests (sub_10, rep_trans)
Provided for automated testing. Contains the tree_increments
tibble produced by inv_increment_repsurv_ccirc with method
"rep_trans". See inc_sub10_rep_classic for details on
the input data.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
processed_heights_bav_sub10,
processed_heights_nfi_sub10,
processed_pulled_sub10
Aggregates tree-level increments to the inventory level in the same
four-element layout as the static base_table_age_class /
base_table_d_q_class family, but for the annual volume increment
(iv_hub_m3_ha_yr) instead of standing volume. It is the increment
counterpart of the static base tables and the per-subunit breakdown analogue
of inv_inc_big_overview_matches_only.
increment_base_table( tree_inc_extd, by_class = c("age", "dq"), tree_filter = TRUE )increment_base_table( tree_inc_extd, by_class = c("age", "dq"), tree_filter = TRUE )
tree_inc_extd |
Either an increment bundle – the output of
|
by_class |
Either |
tree_filter |
Expression describing which trees to keep, internally
passed to |
The function operates on the per-tree increment frame produced by
inv_increment_repeated_survey (repeated survey) or
inv_increment_gnfi3 (single inventory). Both carry the
same per-tree contract, so the same base table is produced regardless of the
increment's origin. Internally the trees are first aggregated to plot level
with inv_inc_tree_2_plot, then area-weighted to the inventory
level via the shared primitive se_area_weighted_grouped.
This is the “plain” aggregation: each plot contributes its single
representation area (area_rep_ha); there is no split into virtual
monospecific areas (that is the job of a separate _main_stand variant).
The per-hectare values therefore relate to one hectare of total forest, and
the per-ha denominator is the full area across all plots in the input. Because
totals are linear in the per-plot values, the species rows of detail
sum (in iv_m3_yr_total) to the matching all_species row, and
total sums to all_total – the central sum-consistency invariant
(confidence intervals are not additive and are computed independently per
level).
A list of four tibbles, mirroring the static base table family:
One row per species group and class.
One row per species group, across all classes.
One row per class, across all species groups (the body of the “Summe” block).
One row, the grand total.
Each carries n_plot_class (the number of inventory points falling
into the group), the annual increment as both an absolute total
(iv_m3_yr_total) and per hectare of operation area
(iv_m3_ha_yr) with their 95% confidence half-widths
(ci95_*), and the counts n_iv_filled / n_iv_total
(gnfi3-estimated vs. total tree increments in the group). The plain table
carries no per-species area_ha (that is the main-stand variant's
job). The list additionally carries a collective
element (a list with kind, label, definition)
describing the tree collective the table represents: "all_layers"
for the default tree_filter, otherwise a "custom" collective
reporting the filter. It is carried through to the output and PDF steps so
the collective can be labelled without re-deriving it. A meta
element carries the header meta attached by inv_inc_tree_extend
(survey years, period, area, point count, Berechnungs-/Ergänzungsmethode),
or NULL for a single-inventory source.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_b <- data_ex3_sample_fe_inventory # Prepare a single inventory's tree data (warnings/messages are ok here) inv_b_trees <- data_ex3_sample_trees_essentials # Single-inventory increment, then the inventory base table inc <- inv_increment_gnfi3(inv_b, inv_b_trees) bt <- increment_base_table(inc, by_class = "age") bt$detail bt$all_totalinv_b <- data_ex3_sample_fe_inventory # Prepare a single inventory's tree data (warnings/messages are ok here) inv_b_trees <- data_ex3_sample_trees_essentials # Single-inventory increment, then the inventory base table inc <- inv_increment_gnfi3(inv_b, inv_b_trees) bt <- increment_base_table(inc, by_class = "age") bt$detail bt$all_total
Main-stand counterpart of increment_base_table: it restricts
the aggregation to the main stand (layer_key == 1, standing trees) and
expresses the per-hectare increment relative to the cohort's virtual
monospecific area rather than to one hectare of total forest. This mirrors
the static base_table_age_class_main_stand /
base_table_d_q_class_main_stand family. As there, species areas
are only formed for the main stand, because area shares of species in mixed
multi-layer stands are methodologically dubious (the same stance the Third
German National Forest Inventory took).
increment_base_table_main_stand(tree_inc_extd, by_class = c("age", "dq"))increment_base_table_main_stand(tree_inc_extd, by_class = c("age", "dq"))
tree_inc_extd |
Either an increment bundle – the output of
|
by_class |
Either |
The virtual areas are built exactly as on the static side: a per-plot correction factor normalises the plot's main-stand standing area to one hectare, and each cohort receives its standing-area share of the plot's representation area. Unlike the static side, the main stand here includes trees removed between the two inventories: their increment counts, and their (inv-1) standing area counts towards the ideal species area, so numerator and denominator span the same collective.
Because every tree that contributes increment also carries a positive standing area (removed trees at inv-1, surviving/ingrowth trees at inv-2), every group that appears has a positive ideal area – so the “species extinct but residual increment” edge case (division by a zero area) cannot arise. It also keeps strong species-share shifts (e.g. after a storm) from producing implausibly large per-ideal-hectare increments, because the removed area enters the denominator as well.
A list of four tibbles (detail, total,
all_species, all_total) like increment_base_table
(with iv_m3_ha_yr and its CI over the whole operation area),
additionally holding area_ha (the ideal monospecific species area)
and iv_m3_ha_yr_virt (the increment per that ideal area, without a
CI). Unlike the static main-stand base tables it deliberately carries no
per-species area-share column (per_species): in the increment context
the ideal area is that of a period collective (including removed trees), so a
percentage share would be more misleading than informative. Like
increment_base_table, the list also carries a
collective element (here fixed to the "main_stand" collective,
“Hauptbestand”) and a meta element with the header meta
attached by inv_inc_tree_extend (NULL for a
single-inventory source).
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) bt <- increment_base_table_main_stand(inc, by_class = "age") bt$detail bt$totalinv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) bt <- increment_base_table_main_stand(inc, by_class = "age") bt$detail bt$total
Yield-table (“Ertragstafel”) counterpart of
increment_base_table_main_stand. It breaks the yield-table
increment estimate down by species group and age or quadratic-mean-diameter
class, for the main stand only, and returns the same four-element layout as
the other increment base tables so it flows through
output_increment_base_table and
output_increment_base_table_pdf unchanged.
increment_ytables_base_table( inv_dat, ytable_selection, by_class = c("age", "dq"), plot_area_weight = TRUE, fe_inv = NULL )increment_ytables_base_table( inv_dat, ytable_selection, by_class = c("age", "dq"), plot_area_weight = TRUE, fe_inv = NULL )
inv_dat |
Normally the result of |
ytable_selection |
A data frame assigning yield-table names to species,
e.g. |
by_class |
Either |
plot_area_weight |
Logical; if |
fe_inv |
Optional |
Yield tables are age-indexed and their increment is expressed per hectare of a
(virtual) monospecific stand, so this table exists only for the main
stand and always relates to ideal species areas – there is no
“all layers” variant. Each species-group cohort on a plot receives its
yield-table increment (see inv_increment_ytables), which is then
aggregated to the inventory level. For by_class = "dq" the cohorts are
grouped by their quadratic mean diameter class (one per plot x species group,
as in back_table_dclass); the underlying per-cohort increment is
still the age-indexed yield-table value.
The confidence-interval columns are absent by design: only the repeated- inventory method carries an empirical CI.
A list of four tibbles (detail, total,
all_species, all_total) plus a collective element (fixed
to “Hauptbestand”), a meta element (marking the source as
"ytable" so the PDF is titled “Ertragstafelschätzung”), and a
ytables_used element (the yield tables actually used, carried through
so the PDF can list them). Each
table carries n_plot_class, iv_m3_yr_total, iv_m3_ha_yr
(over the operation area), area_ha (ideal species area), and
iv_m3_ha_yr_virt (increment per ideal area). The per-species levels
(detail, total) additionally carry site_index (mean
Ertragsklasse); it is omitted from the cross-species all_species /
all_total block, where averaging a site index would be meaningless.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) # Both axes rest on the same estimate increment_ytables_base_table(inc, by_class = "age")$all_total increment_ytables_base_table(inc, by_class = "dq")$all_totalinc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) # Both axes rest on the same estimate increment_ytables_base_table(inc, by_class = "age")$all_total increment_ytables_base_table(inc, by_class = "dq")$all_total
Top-level wrapper that runs both
inv_inc_big_overview_matches_only (for the plots that
appear in both surveys) and inv_inc_big_overview_2nd_only
(for the plots that only appear in the second survey, with a
short-window backward gnfi3 estimate) and combines their results into
one whole-enterprise view. Designed as the data source for
user-facing summary tables of the whole forest enterprise.
inv_inc_big_overview( tree_inc_rep_gapfill, inv_1st_trees, inv_2nd_trees, inv_2nd, style = c("generic", "baysf"), inc_summaric, dt_2nd_only = -5 )inv_inc_big_overview( tree_inc_rep_gapfill, inv_1st_trees, inv_2nd_trees, inv_2nd, style = c("generic", "baysf"), inc_summaric, dt_2nd_only = -5 )
tree_inc_rep_gapfill |
Output of
|
inv_1st_trees, inv_2nd_trees
|
Tree data frames as in
|
inv_2nd |
|
style |
Passed through to
|
inc_summaric |
Output of |
dt_2nd_only |
Estimation period in years for the second-only
backward gnfi3 projection (negative for backward). Default
|
Output layout (the central design decision): three sub-overview
slots that all keep the same internal shape ($overall +
$by_species_group), plus the inv_period and
method info passed through so downstream renderers can label
survey years and the increment method without re-deriving them.
Verbatim output of
inv_inc_big_overview_matches_only.
Verbatim output of
inv_inc_big_overview_2nd_only.
Per-row addition of matches_only and second_only.
One row per matched fill_option (combined_standard,
combined_min_estimates, combined_all_estimates,
combined_inc_summaric), each summing the matched
fill_option result with the single gnfi3_backward
second_only contribution. iv_m3_yr_total and
area_total_ha are additive; iv_m3_ha_yr is the
resulting ratio. Sum-consistency: each combined row's totals
equal the corresponding matches_only row plus the second_only
row.
The same inv_period list element that is
already carried by inv_increment_repsurv_ccirc and
inv_inc_fill_gaps_gnfi3, with the two survey years
and the period length.
The increment method used in the upstream
inv_increment_repsurv_ccirc call (one of
"rep_classic", "rep_mean", "rep_end",
"rep_trans"); carried through so user-facing renderers
can label the table accordingly.
CI95 in $combined: the ci95_* columns are kept for
structural compatibility but are NA throughout. The
second_only contribution carries no empirical CI by contract (see
inv_inc_big_overview_2nd_only); an area-weighted
pooling of variances with one variance unknown would require
assumptions that we are not willing to make here. Users who need a
CI on the combined value can fall back to the matches_only CI as a
lower bound, and document the choice.
iv_by_groups in $combined is deliberately omitted.
The matched side breaks down by id_able_tree × tree_status
(categories that the second_only side does not share), so a mixed
breakdown would have a heterogeneous schema. Users that need that
detail should look at $matches_only$overall$iv_by_groups
separately.
A list with the three top-level slots described above.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory suppressWarnings(suppressMessages({ inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) })) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) bo$combined$overall$iv_totalinv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory suppressWarnings(suppressMessages({ inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) })) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) bo$combined$overall$iv_total
Counterpart to inv_inc_big_overview_matches_only for those plots that
only appear in the second survey (typical case: sample extensions and
newly established plots between two inventories). Their increment cannot
be observed directly; it is estimated per tree by applying the
third-German-NFI growth functions backwards over a short period
(dt, default 5 years) and aggregating across plots with the same
area-weighted machinery as in inv_inc_big_overview_matches_only.
inv_inc_big_overview_2nd_only(inc_repinv_fl, inv_2nd_trees, inv_2nd, dt = -5)inv_inc_big_overview_2nd_only(inc_repinv_fl, inv_2nd_trees, inv_2nd, dt = -5)
inc_repinv_fl |
Output of |
inv_2nd_trees |
Tree data frame from the second inventory, as
produced by |
inv_2nd |
The corresponding |
dt |
Estimation period for the backward gnfi3 projection, in years,
passed through to |
Why a short period and not the full inter-survey distance: on plots without a previous observation we do not know the mortality and removal history. A backward projection over ~10 years would attribute much of the standing volume to "still living" trees and miss the unknown fraction that would actually have died or been harvested in that span. Over a shorter window (~5 years) that bias stays small and the resulting per-year growth rate is a defensible estimate for the representative area of the second-only plots.
The output structure mirrors inv_inc_big_overview_matches_only so that
the two can later be combined into one whole-enterprise table by the
caller. There is, however, no fill_option dimension here: only
one estimator is in play (backward gnfi3 over dt years). A single
label "gnfi3_backward" is used in the fill_option column
so that a row bind with the matched-plots output stays unambiguous.
Current scope and limitations (v1):
Only living trees of the second inventory enter the estimate (filter
!removal). Removal trees on second-only plots are ignored;
their contribution to the period increment would need a separate
mortality model and is left out for now.
The estimate is therefore a "living-tree backward" growth quantity,
not a full balance increment. Be careful when combining the per-ha
results with the matched-plot inc_summaric reference value,
which does include mortality.
The ci95_* columns are present for structural
compatibility with inv_inc_big_overview_matches_only but contain
NA throughout. All per-plot increments here come from a
model (backward gnfi3 over a short window), not from empirical
re-measurement; the only source of plot-to-plot scatter is then
what the model itself produces on top of the actual tree sample.
A confidence interval computed from that scatter would suggest a
precision the underlying numbers do not have. Downstream code that
merges this output with the matched-plots overview must therefore
treat the 2nd-only CI columns as missing-on-purpose.
A list with the same top-level structure as
inv_inc_big_overview_matches_only: $overall (containing
iv_by_groups, iv_total, v_total, n_plots)
and $by_species_group (containing iv_by_groups,
iv_total, v_total). All m3/ha values relate to the
total area across all second-only plots, even when grouped by
species; plots without trees of a given species_group contribute
their area but a zero numerator, so sums of per-species values
match the corresponding overall values.
If there are no second-only plots, an empty-shaped list is returned
with zero rows in the tables and area_total_ha = 0 in
n_plots; this lets downstream combination code merge the two
overviews without special-casing.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials suppressWarnings(suppressMessages({ # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills })) bo_2nd <- inv_inc_big_overview_2nd_only(inc_fl, inv_b_trees, inv_b) bo_2nd$overall$iv_total bo_2nd$by_species_group$iv_totalinv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials suppressWarnings(suppressMessages({ # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills })) bo_2nd <- inv_inc_big_overview_2nd_only(inc_fl, inv_b_trees, inv_b) bo_2nd$overall$iv_total bo_2nd$by_species_group$iv_total
Produces the area-weighted increment overview from those plots that
appear in both inventories — i.e. the subset for which repeated
tree-level measurements are available. The companion function
inv_inc_big_overview_2nd_only covers the plots that only
exist in the second survey (new establishments, sample extensions);
the top-level inv_inc_big_overview_matches_only combines both.
inv_inc_big_overview_matches_only( tree_inc_rep_gapfill, inv_1st_trees, inv_2nd_trees, inv_2nd, style = c("generic", "baysf"), inc_summaric )inv_inc_big_overview_matches_only( tree_inc_rep_gapfill, inv_1st_trees, inv_2nd_trees, inv_2nd, style = c("generic", "baysf"), inc_summaric )
tree_inc_rep_gapfill |
Output object of
|
inv_1st_trees |
Tree data frame as pulled and extended from the the
|
inv_2nd_trees |
Tree data frame as pulled and extended from the the
|
inv_2nd |
|
style |
Two options
|
inc_summaric |
Output of |
A list with three top-level elements:
A sub-list with
Increments aggregated by fill_option, tree identification status, and tree status category
Total increments per fill_option, plus an
additional row "inc_summaric" with the summaric
(yield-history) increment as the most reliable reference value
Total standing volume at the second inventory
Number of plots and total represented area
A sub-list with the same structure as
overall (minus n_plots, which would be redundant),
but every tibble is additionally grouped by species_group.
The total area (area_total_ha) stays at the area across all
plots, so that plots without trees of a given species group still
contribute their area to the denominator. Consequently, sums of
per-species values (iv_m3_yr_total, iv_m3_ha_yr,
v_hub_m3_ha) across species groups match the corresponding
overall values, and the same applies row by row to the appended
"inc_summaric" entries.
The increment method used in the upstream
inv_increment_repsurv_ccirc call (carried through
inv_inc_fill_gaps_gnfi3).
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Compute the summaric increment per plot (required for big_overview). # Note: summaric reads matched_trees and fills_forward directly — it # does NOT go through the consolidate / extend per-tree pipeline, # so its balance always sees the full measured population. inc_sum <- inv_inc_summaric( inc_repinv$tree_increments, inc_repinv_fl$fills_forward, inv_a_trees, inv_b_trees ) # Finally generate the matched-plots overview, use both styles inv_inc_big_overview_matches_only( inc_repinv_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) inv_inc_big_overview_matches_only( inc_repinv_fl, inv_a_trees, inv_b_trees, inv_b, style = "baysf", inc_summaric = inc_sum )# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Compute the summaric increment per plot (required for big_overview). # Note: summaric reads matched_trees and fills_forward directly — it # does NOT go through the consolidate / extend per-tree pipeline, # so its balance always sees the full measured population. inc_sum <- inv_inc_summaric( inc_repinv$tree_increments, inc_repinv_fl$fills_forward, inv_a_trees, inv_b_trees ) # Finally generate the matched-plots overview, use both styles inv_inc_big_overview_matches_only( inc_repinv_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) inv_inc_big_overview_matches_only( inc_repinv_fl, inv_a_trees, inv_b_trees, inv_b, style = "baysf", inc_summaric = inc_sum )
When calculating tree level increments from two subsequent inventories, there
are typically trees that were present in one of the inventories only. For
different types of such trees, we apply here the single tree growth
functions from the third German National Forest Inventory
(Riedel et al. 2017) as implemented
in the Package ForestElementsR, namely the functions
d_age_gnfi3 and
h_age_gnfi3.
inv_inc_fill_gaps_gnfi3( tree_inc_rep, inv_1st_trees, inv_2nd_trees, include_reptrees = TRUE )inv_inc_fill_gaps_gnfi3( tree_inc_rep, inv_1st_trees, inv_2nd_trees, include_reptrees = TRUE )
tree_inc_rep |
Output of |
inv_1st_trees |
Extended tree data frame for the first inventory,
exactly as it was used as an input to
|
inv_2nd_trees |
Extended tree data frame for the second inventory,
exactly as it was used as an input to
|
include_reptrees |
If |
The increment estimates performed here are only applied to inventory plots
that match in both inventories. This is guaranteed by requiring
tree_inc_rep as input object. This is the output of
inv_increment_repsurv_ccirc which ensures plot matching.
A list comprising five data frames that have exactly the same
structure, i.e. the same columns as tree_inc_rep$tree_increments,
however with two additional columns,iv_hub_m3_per_gnfi3, and
iv_hub_m3_yr_gnfi3). The data frame fills_forward relates to
trees that were present in the first, but missing in the second inventory.
Their increment is projected forward up to the mid of the period between
both inventories. The second data frame fills_backward comprises
trees that were present in the second, but not present in the first
inventory. Their increment is estimated backwards for the whole period. The
third data frame fills_backward_nomatch comprises trees present
in the second inventory, which were, however, not recorded in a way that
makes them identifyable in the first inventory (typically, such trees are
under a certain dbh threshold). For such trees backward increment estimates
are made for the whole period. The fourth data frame
fills_backward_implausible comprises trees that were present in both
inventories but flagged as implausible during tree matching (due to
excessive volume shrinkage or species mismatch). These trees received a
zero increment from the repeated measurement; their increment is estimated
backwards from the second inventory's values for the whole period. The
fifth data frame fills_backward_reptrees relates to plausible trees
that were present in both inventories. While directly calculated increments
are available for these trees, backward estimates are calculated if
(include_reptrees) is TRUE. This might only be required under
special circumstances, therefore, the default setting is FALSE
for saving time. In the latter case, the columns reserved for the
increment estimates are set to NA. In addition the list contains the
elements inv_period (carried through from
inv_increment_repsurv_ccirc), plot_matches
(the plot match overview, also from inv_increment_repsurv_ccirc;
downstream consumers such as
inv_inc_big_overview_2nd_only use the
in_b_only entry there to identify plots that only appear in the
second inventory), and method (the increment method used in
the upstream inv_increment_repsurv_ccirc call –
one of "rep_classic", "rep_mean", "rep_end",
"rep_trans").
Riedel T, Hennig P, Kroiher F, Polley H, Schmitz F, F. S (2017). Die dritte Bundeswaldinventur (BWI 2012). Inventur- und Auswertungsmethoden. Thuenen Institut fuer Waldoekosysteme.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The matching this builds on is shipped ready-made for the pair, see # ?data_ex3_increment_interim inc_repinv <- data_ex3_increment_matched # Finally, fill the gaps. include_reptrees = FALSE estimates only where # there is a gap; the default TRUE also estimates for trees measured # twice, which is what fill_option = "all_estimates" later feeds on. inv_inc_fill_gaps_gnfi3( inc_repinv, inv_a_trees, inv_b_trees, include_reptrees = TRUE )# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The matching this builds on is shipped ready-made for the pair, see # ?data_ex3_increment_interim inc_repinv <- data_ex3_increment_matched # Finally, fill the gaps. include_reptrees = FALSE estimates only where # there is a gap; the default TRUE also estimates for trees measured # twice, which is what fill_option = "all_estimates" later feeds on. inv_inc_fill_gaps_gnfi3( inc_repinv, inv_a_trees, inv_b_trees, include_reptrees = TRUE )
Computes a pure balance increment per plot that does not require any tree
matching assumptions. The formula is:
inc_summaric = (V_end - V_start + V_removed) / period, where
V_end is the total standing volume at the second inventory (excluding
removed trees), V_start is the total standing volume at the first
inventory, and V_removed is the forward-estimated volume of trees
that were removed between inventories. The forward estimation relies on
gnfi3-based estimates from the "standard" fill option, which is why the
input must come from inv_inc_tree_consolidate with
fill_option = "standard", extended by
inv_inc_tree_extend.
inv_inc_summaric(matched_trees, fills_forward, inv_1st_trees, inv_2nd_trees)inv_inc_summaric(matched_trees, fills_forward, inv_1st_trees, inv_2nd_trees)
matched_trees |
Data frame, the |
fills_forward |
Data frame, the |
inv_1st_trees |
Tree data frame as pulled and extended from the
first |
inv_2nd_trees |
Tree data frame for the second inventory. Used for the species-group lookup of trees that exist in the second inventory (the dominant case — both-exist trees, ingrowth, and unmatchable inv-2). |
The classical German forestry term for this quantity is "ertragsgeschichtlicher Zuwachs" (literally: yield-history increment). There is no established English equivalent; we use the term "summaric increment" here to express that this increment is derived purely from summary-level volume balances between two inventories, without relying on individual tree identity across surveys.
Methodological role. The ertragsgeschichtliche increment is the
Goldstandard for the Betriebsebenen-Zuwachs — the best estimate of
the enterprise-wide annual increment that two inventories can yield.
Unlike the four single-tree methods (rep_classic, rep_mean,
rep_end, rep_trans) it is a pure mass balance over the
measured tree population; it does not depend on assumptions about
which inventory's representation number to use for trees that change
circles, and it does not need a per-tree pairing across inventories.
For that reason it stands architecturally apart from the per-tree
pipeline (inv_inc_tree_consolidate and
inv_inc_tree_extend): summaric pulls its inputs
(matched_trees, fills_forward, and the inv-trees lookups
for species groups) directly, so its balance always sees the full
measured population including the unmatchable inner-circle cohort —
independent of any fill_option choice on the per-tree side.
Computational structure on each plot:
v_hub_m3_ha_1st: sum of n_rep_ha_1st * v_hub_m3_1st
over all inv-1 measurements present in matched_trees,
including the rows flagged is_unmatchable_1st = TRUE (e.g.
inner-circle trees recorded without polar coordinates).
v_hub_m3_ha_2nd: sum of n_rep_ha_2nd * v_hub_m3_2nd
over all living inv-2 measurements (no removal flag), including
unmatchable inv-2 rows and the inv-2 records of pseudo-ingrowth-
reclassified trees (the latter contribute only their inv-2 volume
after the local undo described below).
v_hub_m3_ha_aus: sum of n_rep_ha_1st * v_hub_m3_1st
plus the half-period gnfi3 forward estimate, over the
verified-ausscheider subset (tree_exists_1st is TRUE and
either tree_exists_2nd is FALSE or the tree carries a
removal flag at inv 2). The forward estimate is pulled from
fills_forward. Unmatchable rows have NA on the counterpart
side and are filtered out by NA-semantics so they never inflate
v_aus.
Pseudo-ingrowth-reclassified trees have their reclassification locally undone inside summaric so that their inv-1 reconstruction (gnfi3 backward) does not enter the balance. They contribute only via their measured inv-2 volume — exactly the methodological treatment we want for the unmatchable inner-circle cohort.
A list with two tibbles:
One row per plot, columns plot_id,
v_hub_m3_ha_1st, v_hub_m3_ha_2nd,
v_hub_m3_ha_aus, inc_summaric_m3_ha_yr.
One row per (plot, species_group) combination,
same volume / increment columns as overall plus
species_group. Combinations where a species group is absent
on a plot are not represented; consumers that need a complete grid
(e.g. for area-weighted aggregation across all plots) must fill in
zeros.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Pull and prepare tree data inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Summaric goes directly off matched_trees + fills_forward — # no consolidate / extend in between. inv_inc_summaric( inc_repinv$tree_increments, inc_repinv_fl$fills_forward, inv_a_trees, inv_b_trees )# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Pull and prepare tree data inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Summaric goes directly off matched_trees + fills_forward — # no consolidate / extend in between. inv_inc_summaric( inc_repinv$tree_increments, inc_repinv_fl$fills_forward, inv_a_trees, inv_b_trees )
The ha-related values calculated here are to be understood as the
contributions of each tree cohort (as defined by species group, (age- or
diameter-) class, and layer) to the whole ha-wise increment of the plot.
Importantly, they do not relate to virtual area shares of the cohorts.
In an increment evaluation workflow, the intended use of this function is to
be applied to the output of
inv_inc_tree_extend
inv_inc_tree_2_plot(tree_inc_extd, by_class = c("age", "dq"))inv_inc_tree_2_plot(tree_inc_extd, by_class = c("age", "dq"))
tree_inc_extd |
Data frame, output of |
by_class |
Two options "age" (default), and "dq", which will aggregate the increments by age-, and mean diameter classes, respectively. |
A data frame with increment sums grouped by plot_id,
species_group, d_q_class or age_class,
layer_key, removal
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Consolidate and extend tree increments inc_repinv_ce <- inv_inc_tree_consolidate(inc_repinv_fl) |> inv_inc_tree_extend(inv_a_trees, inv_b_trees, inv_b) # Finally, aggregate on plot level inv_inc_tree_2_plot(inc_repinv_ce, "age") inv_inc_tree_2_plot(inc_repinv_ce, "dq")# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Consolidate and extend tree increments inc_repinv_ce <- inv_inc_tree_consolidate(inc_repinv_fl) |> inv_inc_tree_extend(inv_a_trees, inv_b_trees, inv_b) # Finally, aggregate on plot level inv_inc_tree_2_plot(inc_repinv_ce, "age") inv_inc_tree_2_plot(inc_repinv_ce, "dq")
In an increment evaluation workflow, the intended use of this function is to
be applied to the output of
inv_inc_fill_gaps_gnfi3. In parallel to the
increment values that were directly calculated, the latter has estimated
the increment with the tree growth functions from the Third German National
Forest Inventory (Riedel et al. 2017) for different
cohorts of trees (in different ways, see
inv_inc_fill_gaps_gnfi3). Here, the user decides which
increments to use for which cohort in subsequent evaluations.
inv_inc_tree_consolidate( tree_inc_rep_gapfill, fill_option = c("standard", "min_estimates", "all_estimates") )inv_inc_tree_consolidate( tree_inc_rep_gapfill, fill_option = c("standard", "min_estimates", "all_estimates") )
tree_inc_rep_gapfill |
Output object of
|
fill_option |
Three options, "standard" (default), "min_estimates", and "all_estimates". See Details. |
The fill_option "standard" takes the inventory increment for all
trees that can be potentially identified across inventories and are present
at least in the second survey (i.e. re-measured or ingrown), as long as they
do not have a removal flag at the second survey. For such trees
that are, however, present in the first survey but are absent or have a removal
flag at the second survey, an NFI based forward increment estimate for half
the period between the surveys is used. Trees that cannot be identified
across inventories and are present in the second survey, obtain a backwards
increment estimate for the whole period. The option "min_estimates" uses
NFI estimates only for trees that cannot be identified across surveys.
Therefore, trees that only exist in the first survey obtain a zero increment.
The third option "all_estimates" uses NFI based estimates for all trees.
A data frame with every line representing a tree, actually all
output components from inv_inc_fill_gaps_gnfi3 combined
into one data frame. Importantly, there are three additional columns:
iv_hub_m3_per and iv_hub_m3_yr are the periodic and annual
increment values to continue calculating with (coming either from the
inventory or from the estimate), and iv_filled is logical; if
TRUE, the increment is estimated with the German NFI growth functions.
If FALSE the increment is directly calculated from the survey data.
Riedel T, Hennig P, Kroiher F, Polley H, Schmitz F, F. S (2017). Die dritte Bundeswaldinventur (BWI 2012). Inventur- und Auswertungsmethoden. Thuenen Institut fuer Waldoekosysteme.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Finally, consolidate the tree increments, try all fill options inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "standard") inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "min_estimates") inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "all_estimates") # The option 'all_estimates' must throw an error if the gap filling was # not done for the trees which have dbh values in both surveys inc_repinv_fl <- inv_inc_fill_gaps_gnfi3( inc_repinv, inv_a_trees, inv_b_trees, include_reptrees = FALSE ) try( inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "all_estimates") )# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Finally, consolidate the tree increments, try all fill options inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "standard") inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "min_estimates") inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "all_estimates") # The option 'all_estimates' must throw an error if the gap filling was # not done for the trees which have dbh values in both surveys inc_repinv_fl <- inv_inc_fill_gaps_gnfi3( inc_repinv, inv_a_trees, inv_b_trees, include_reptrees = FALSE ) try( inv_inc_tree_consolidate(inc_repinv_fl, fill_option = "all_estimates") )
In an increment evaluation workflow, the intended use of this function is to
be applied to the output of inv_inc_tree_consolidate
inv_inc_tree_extend( tree_inc_cons, inv_1st_trees, inv_2nd_trees, inv_2nd, d_q_interval = 10 )inv_inc_tree_extend( tree_inc_cons, inv_1st_trees, inv_2nd_trees, inv_2nd, d_q_interval = 10 )
tree_inc_cons |
A data frame with consolidated tree level increments,
typically the output of |
inv_1st_trees |
Tree data frame as pulled and extended from the the
|
inv_2nd_trees |
Tree data frame as pulled and extended from the the
|
inv_2nd |
|
d_q_interval |
Numeric value, represents the width (cm) of the
quadratic mean diameter (d_q) classes to be added to the output data frame.
This argument is passed to the function |
A data frame where each row represents a tree, with extended
information about increment and other tree level variables. The two
columns time_yr_prev and time_yr_2nd are uniform across
all rows and describe the survey years of the inventory pair (1st and
2nd survey, respectively); their difference is the inter-survey
period. time_yr is the time of the tree's actual observation
in the join partner inventory and equals time_yr_prev for trees
that exist only in the first survey. The result also carries an
"inc_meta" attribute (survey years, period, area, point count,
Berechnungs-/Ergänzungsmethode) that the increment base tables promote
into their header meta block.
The result covers only the plots measured in both inventories. Plots
that exist just in the second survey are not part of the repeated-survey
matching and therefore absent here. Feeding this frame straight into
increment_base_table or
increment_base_table_main_stand understates every
per-hectare figure, because those tables divide by the full operation area
(from the "inc_meta" attribute) while the second-only plots contribute
no increment – their area sits in the denominator with nothing in the
numerator. Pass the result through
inv_inc_tree_extend_combined first, or, simpler, use
inv_increment_repeated_survey, which runs the whole chain
including that step.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Consolidate tree increments inc_repinv_cons <- inv_inc_tree_consolidate(inc_repinv_fl) # Extend with tree information required for further aggregation inv_inc_tree_extend(inc_repinv_cons, inv_a_trees, inv_b_trees, inv_b)# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Matching and gap filling for this pair are shipped ready-made, see # ?data_ex3_increment_interim for how they were built inc_repinv <- data_ex3_increment_matched inc_repinv_fl <- data_ex3_increment_fills # Consolidate tree increments inc_repinv_cons <- inv_inc_tree_consolidate(inc_repinv_fl) # Extend with tree information required for further aggregation inv_inc_tree_extend(inc_repinv_cons, inv_a_trees, inv_b_trees, inv_b)
Extends the per-tree increment frame of a repeated survey – the output of
inv_inc_tree_extend, which covers only the plots measured in
both inventories – with the plots that exist only in the second survey
(new establishments, sample extensions). These second-only plots receive a
short-window backward gnfi3 estimate via
inv_inc_tree_extend_single (default dt = -5, the same
convention as inv_inc_big_overview_2nd_only), and the two
per-tree frames are row-bound into one.
inv_inc_tree_extend_combined( tree_inc_extd, inc_repinv_fl, inv_2nd_trees, dt = -5, d_q_interval = 10 )inv_inc_tree_extend_combined( tree_inc_extd, inc_repinv_fl, inv_2nd_trees, dt = -5, d_q_interval = 10 )
tree_inc_extd |
Per-tree increment frame of the matched plots, the
output of |
inc_repinv_fl |
Output of |
inv_2nd_trees |
Tree data frame of the second survey (as pulled,
height-completed and passed through |
dt |
Time span (years) for the second-only backward gnfi3 estimate,
passed to |
d_q_interval |
Numeric, width (cm) of the quadratic mean diameter (d_q)
classes, passed on to |
The point of this function is the shared per-tree contract: both
inv_inc_tree_extend and inv_inc_tree_extend_single
emit the same columns consumed by inv_inc_tree_2_plot, so the
combined frame runs through increment_base_table and
increment_base_table_main_stand unchanged. The resulting
base tables then cover the whole enterprise (matched plus second-only
plots) instead of only the matched subset, so their per-hectare increment
relates to the full operation area – consistent with the enterprise-level
inv_inc_big_overview (where
combined = matches_only + second_only).
Only living trees (!removal) of the second-only plots enter the
estimate, mirroring inv_inc_big_overview_2nd_only: a plot without
a predecessor survey has no between-inventory removals to capture, so a removal
flag there marks a tree that is not part of the period's standing increment.
The matched frame is left exactly as it is (it keeps its removed trees, whose
increment is part of the period's production – the “Weg B” convention).
The header meta carried by tree_inc_extd already describes the whole
enterprise (its area and point count come from the full second inventory
passed to inv_inc_tree_extend), so it is simply re-attached to
the combined frame (row-binding drops attributes).
A per-tree increment data frame with the same contract as
inv_inc_tree_extend, now spanning matched and second-only
plots, carrying the (whole-enterprise) "inc_meta" attribute of
tree_inc_extd. If there are no second-only plots (or none with living
trees), tree_inc_extd is returned unchanged.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials suppressWarnings(suppressMessages({ # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_extd <- inv_inc_tree_consolidate(inc_fl) |> inv_inc_tree_extend(inv_a_trees, inv_b_trees, inv_b) })) # Fold in the second-only plots -> whole-enterprise per-tree frame inc_extd_all <- inv_inc_tree_extend_combined( inc_extd, inc_fl, inv_b_trees ) # Base tables now cover matched + second-only plots (run unchanged) increment_base_table(inc_extd_all, by_class = "age")$all_total# Identify two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials suppressWarnings(suppressMessages({ # Matching and gap filling are shipped ready-made for this pair inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_extd <- inv_inc_tree_consolidate(inc_fl) |> inv_inc_tree_extend(inv_a_trees, inv_b_trees, inv_b) })) # Fold in the second-only plots -> whole-enterprise per-tree frame inc_extd_all <- inv_inc_tree_extend_combined( inc_extd, inc_fl, inv_b_trees ) # Base tables now cover matched + second-only plots (run unchanged) increment_base_table(inc_extd_all, by_class = "age")$all_total
Covers the whole chain from a prepared tree list to a ready-to-aggregate
increment result, using the single-tree growth functions of the third German
National Forest Inventory (Riedel et al. 2017). It is the
single-inventory counterpart of
inv_increment_repeated_survey: both return the same kind of
object, so everything downstream – the increment base tables, the overview,
and their PDF reports – is served in exactly the same way.
inv_increment_gnfi3( inv, inv_trees, dt = 5, d_q_interval = 10, keep_steps = FALSE )inv_increment_gnfi3( inv, inv_trees, dt = 5, d_q_interval = 10, keep_steps = FALSE )
inv |
An |
inv_trees |
Tree data frame as pulled from |
dt |
Time span in years the estimate spans. Positive values look forward, negative values backward. Default is five years; the further such an estimate reaches, the less it can account for removals, mortality and ingrowth. |
d_q_interval |
Width of the quadratic mean diameter classes in cm,
passed to |
keep_steps |
Logical. If |
The increment is estimated per tree and for the whole population, not
only for the collective that happens to be reported afterwards. Any
collective can therefore be aggregated from the result: the main stand, all
layers, or a selection of your own via the tree_filter argument of the
base-table functions.
Because the estimate ages each tree by dt years, the age of every tree
is required. If ages are missing, the function stops rather than silently
evaluating the part of the population that happens to carry one.
An object of class fe_increment_gnfi3, which inherits from
fe_increment. A list with the elements
the per-tree increments, covering all layers,
the aggregation to inventory level, overall and by species group,
the figures the reports print in their header,
the intermediate results, or NULL (see
keep_steps).
Riedel T, Hennig P, Kroiher F, Polley H, Schmitz F, F. S (2017). Die dritte Bundeswaldinventur (BWI 2012). Inventur- und Auswertungsmethoden. Thuenen Institut fuer Waldoekosysteme.
inv_increment_repeated_survey for the repeated-survey
counterpart, increment_base_table and
increment_base_table_main_stand for the class tables,
output_increment_overview_gnfi3 for the species-group
overview.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inc <- inv_increment_gnfi3( inv = data_ex3_sample_fe_inventory, inv_trees = data_ex3_sample_trees_essentials ) inc # Increment of the whole inventory, m3 per hectare and year inc$overview$overall$iv_total$iv_m3_ha_yr # Broken down by species group and age class increment_base_table(inc, by_class = "age")$all_totalinc <- inv_increment_gnfi3( inv = data_ex3_sample_fe_inventory, inv_trees = data_ex3_sample_trees_essentials ) inc # Increment of the whole inventory, m3 per hectare and year inc$overview$overall$iv_total$iv_m3_ha_yr # Broken down by species group and age class increment_base_table(inc, by_class = "age")$all_total
Calculates the volume increment of a pair of subsequent inventories and
returns everything the output functions need. This is the standard entry
point for the repeated-survey increment (“Verfahren 1”): it runs the
six-step chain
inv_increment_repsurv_ccirc ->
inv_inc_fill_gaps_gnfi3 ->
inv_inc_tree_consolidate ->
inv_inc_tree_extend ->
inv_inc_tree_extend_combined ->
inv_inc_big_overview in the right order, with the tree lists
handed on where they are needed, so that callers do not have to reproduce it.
inv_increment_repeated_survey( inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), fill_option = c("standard", "min_estimates", "all_estimates"), match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), clamp_plausible_shrinkage = TRUE, coord_tolerance = 10, include_reptrees = TRUE, include_second_only = TRUE, d_q_interval = 10, dt_second_only = -5, style = c("baysf", "generic"), progress_bar = TRUE, keep_steps = FALSE )inv_increment_repeated_survey( inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), fill_option = c("standard", "min_estimates", "all_estimates"), match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), clamp_plausible_shrinkage = TRUE, coord_tolerance = 10, include_reptrees = TRUE, include_second_only = TRUE, d_q_interval = 10, dt_second_only = -5, style = c("baysf", "generic"), progress_bar = TRUE, keep_steps = FALSE )
inv_1st, inv_2nd
|
The two |
inv_1st_trees, inv_2nd_trees
|
The matching tree data frames, as pulled
from the two inventories and prepared with the canonical chain
|
method |
The repeated-survey increment method, one of
|
fill_option |
How the gnfi3 gap-filling estimates are used, one of
|
match_type, plot_id_style, tree_id_style, coord_tolerance
|
Plot- and
tree-matching arguments, passed to
|
inner_circle_non_matchable, shrinkage_rate_per_decade, species_check, clamp_plausible_shrinkage
|
Further arguments of |
include_reptrees |
Passed to |
include_second_only |
Logical, whether plots that exist only in the
second survey are folded in. Default |
d_q_interval |
Numeric, width (cm) of the quadratic mean diameter
classes. Passed to |
dt_second_only |
Time span (years, negative = backward) of the gnfi3
estimate for the second-only plots. Default |
style |
Species grouping style of the enterprise-level overview,
|
progress_bar |
Logical, whether the function displays a console progress
bar itself. Default |
keep_steps |
Logical. If |
The individual step functions stay exported and are the expert-level interface: use them when a single stage has to be inspected, varied or replaced. For everything else this function is the intended route, and it is the one whose result is guaranteed to be internally consistent.
An object of class fe_increment_repsurv (which inherits from
fe_increment), a list with
The per-tree increment data frame covering the whole
enterprise, carrying the "inc_meta" attribute. This is the input
for increment_base_table and
increment_base_table_main_stand.
The enterprise-level aggregate, output of
inv_inc_big_overview, input for
output_increment_overall.
The summaric (ertragsgeschichtlicher) increment,
output of inv_inc_summaric – the gold standard at
enterprise level.
The header meta (survey years, period, area, point count, calculation method, fill option).
The intermediate results of the chain (tree_level,
filled, consolidated, extended_matched) for
inspection, or NULL – see keep_steps.
This is a sample inventory method and applies only to sample
inventories in concentric circles (Stichprobeninventur, taxonomy axis
sample x concentric). Both fe_inventory objects must
consist entirely of
fe_ccircle_spatial plots (its _notrees
child included) – the tree matching relies on the plot geometry and the tree
positions those objects carry. Stand-wise inventories (standwise x
relascope, plain fe_stand plots) carry no tree positions and
therefore have no repeated-survey increment; they are rejected with an error
by inv_increment_repsurv_ccirc_check_input, which runs first.
The two surveys must further be a genuine pair: the same enterprise, the
first one earlier than the second, at least one year apart.
The per-tree result covers the whole enterprise, not just the plots measured
twice. Plots that exist only in the second survey (new establishments, sample
extensions) cannot have a repeated-survey increment by construction, so they
receive a backward gnfi3 estimate via
inv_inc_tree_extend_combined. This matters for more than
completeness: the increment base tables express their per-hectare increment
over the full operation area, so leaving these plots out would put
their area into the denominator while their increment is missing from the
numerator, and every per-hectare figure would come out too low. With them
folded in, the base tables reproduce the enterprise level
(inv_inc_big_overview's combined rows) exactly. Set
include_second_only = FALSE only to reproduce the matched-plots-only
view, and be aware of the bias just described.
The chain reports its seven phases through the progressr framework.
With the default progress_bar = TRUE the function displays a console
bar itself, so an interactive user needs no ceremony. With
progress_bar = FALSE it only signals progress and the caller
decides what to do with it – notably a Shiny app, which wraps the call in
progressr::withProgressShiny() and gets its own progress bar without
FeNEU knowing anything about Shiny. Always pass progress_bar = FALSE
when supplying a handler yourself, otherwise two handlers compete. The phase
labels are translated (options(fe_lang = "de")).
The progress bars of the inner steps are switched off deliberately
(inv_increment_repsurv_ccirc is called with
progress_bar = FALSE): the tree matching would otherwise draw its own
per-plot bar over the phase bar of this function. Progress is reported at
this level only.
increment_base_table,
increment_base_table_main_stand,
output_increment_overall,
output_increment_base_table_pdf
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # The prepared tree lists ship with the package; how they were built with # the canonical chain is shown in ?data_ex3_trees_essentials inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The whole chain in one call suppressWarnings(suppressMessages({ inc <- inv_increment_repeated_survey( inv_a, inv_b, inv_a_trees, inv_b_trees, method = "rep_classic", fill_option = "standard", progress_bar = FALSE ) })) # Enterprise level, and the base tables built on the same object inc$overview$combined$overall$iv_total increment_base_table(inc, by_class = "age")$all_totalinv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # The prepared tree lists ship with the package; how they were built with # the canonical chain is shown in ?data_ex3_trees_essentials inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The whole chain in one call suppressWarnings(suppressMessages({ inc <- inv_increment_repeated_survey( inv_a, inv_b, inv_a_trees, inv_b_trees, method = "rep_classic", fill_option = "standard", progress_bar = FALSE ) })) # Enterprise level, and the base tables built on the same object inc$overview$combined$overall$iv_total increment_base_table(inc, by_class = "age")$all_total
Main function to be used when calculating tree-level increments based on
repeated inventories with concentric circle sample plots
(fe_ccircle_spatial).
inv_increment_repsurv_ccirc( inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), tree_id_style = c("baysf", "generic"), method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), clamp_plausible_shrinkage = TRUE, coord_tolerance = 10, progress_bar = TRUE )inv_increment_repsurv_ccirc( inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), tree_id_style = c("baysf", "generic"), method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), clamp_plausible_shrinkage = TRUE, coord_tolerance = 10, progress_bar = TRUE )
inv_1st |
|
inv_2nd |
|
inv_1st_trees |
A data frame resulting from applying the functions
|
inv_2nd_trees |
A data frame resulting from applying the functions
|
match_type |
Character string indicating the method for matching
inventory plots from the two subsequent inventories. The option
"center_coord" matches points whose center coordinates have a distance of
no more than |
plot_id_style |
Character string indicating the plot_id style to be
used. Only relevant when |
tree_id_style |
Character string that indicates how trees are uniquely identified on inventory plot level. This is required for matching trees on the same plot in both inventories. The options are "baysf" (default) and "generic". In the BaySF case, trees are matched by their polar coordinates, while in the generic case, the tree_ids must mark the same trees in both inventories. |
method |
Character string, choices are |
inner_circle_non_matchable |
Logical, default |
shrinkage_rate_per_decade |
Numeric, the maximum plausible volume
shrinkage rate per decade for re-measured trees. Trees exceeding this
threshold are flagged as implausible. Uses an exponential decay model
internally, scaled to the actual survey interval. Default is |
species_check |
Character string controlling how species consistency
is checked for re-measured trees. Options are |
clamp_plausible_shrinkage |
Logical. If |
coord_tolerance |
Maximum distance allowed for a match of two inventory
plots in the distance unit of the coordinate reference system of
|
progress_bar |
Boolean, if |
Even though the volume increments are calculated on tree level here, they are
upscaled to 1 ha. This is important, because otherwise the increment
represented by trees that change their representation number per ha between
both inventories cannot be calculated correctly. Trees present in the first
survey only always get zero increment; such values can be replaced by
model-based estimates in a subsequent step. The function allows to choose
between four methods of increment calculation (parameter method):
rep_classic: The volume increment, , of trees that are
present in both inventories is calculated as
, with and being
the representation number per hectare and the volume of the tree at the
first and the second survey, respectively. The volume increment of the
ingrowth trees is , i.e. such trees contribute to the
increment with their full volume. This method is equivalent to the
classic stand level increment calculation (German "Ertragsgeschichtlicher
Zuwachs"), however, some trees (and plots) may also have negative
increments. This might look strange, but is fully valid from a
statistical angle of view.
rep_mean: The volume increment, , of trees that are
present in both inventories is calculated as
, and the volume increment of
ingrowth trees is calculated as , where
is the tree's volume when it crossed the sampling
threshold. This method is not compatible to the classic stand level
increment calculation. Guarantees when
clamp_plausible_shrinkage = TRUE.
rep_end: The volume increment, , of trees that are
present in both inventories is calculated as
, and the volume increment of
ingrowth trees is calculated as , where
is the tree's volume when it crossed the sampling
threshold. This method is not compatible to the classic stand level
increment calculation. Guarantees when
clamp_plausible_shrinkage = TRUE.
rep_trans: The volume increment, , of trees that are
present in both inventories, and did not cross a sampling threshold,
is calculated as , with .
For trees that crossed a sampling threshold, the calculation is
.
The volume increment of ingrowth trees is calculated as
, where is the tree's volume when it
crossed the sampling threshold. This method is not compatible to the
classic stand level increment calculation and always guarantees
(negative volume differences are clamped to zero regardless
of clamp_plausible_shrinkage).
A list with six elements: i) tree_increments is a data frame
that identifies all trees that were appropriate for increment calculation
with their plot and tree id in both inventories, and contains their annual
and periodic volume increment (in m³/ha under bark after harvest). Note
that in case of decreasing representation numbers between both surveys,
increments can be also become negative which is statistically correct. ii)
plot_matches informs about the outcome of the required plot matching
across both inventories. It is the output of
match_2_inventories which is called internally. iii)
match_plot_stats which gives an overview of the plot matching
results in terms of plot numbers and representation areas (i.e. the output
of an internal call to match_plot_statistics). iv)
match_tree_stats provides similar overview statistics on tree level.
v) inv_period is the output of inv_period, computed
once here so downstream functions can access the survey years and the
inter-survey period without having to carry the fe_inventory
objects further. vi) method is the increment method that was
used in this call (one of "rep_classic", "rep_mean",
"rep_end", "rep_trans"); carried through so downstream
consumers can label outputs accordingly.
This is the first of six steps that lead from a pair of inventories to
the increment tables and their PDFs. Unless a single stage has to be inspected
or varied, call inv_increment_repeated_survey instead: it runs
the whole chain in one call, hands the tree lists on where they are needed,
and – importantly – includes the plots that exist only in the second survey,
which a hand-built chain easily forgets (see the coverage warning in
inv_inc_tree_extend).
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The two match types. "center_coord" pairs plots by their centres within # a tolerance, "plot_id" by their identifiers. inv_increment_repsurv_ccirc( inv_a, inv_b, inv_a_trees, inv_b_trees, match_type = "center_coord", coord_tolerance = 10, method = "rep_classic" ) # The four methods differ only in how the increment of a single tree is # formed; "rep_classic" above and "rep_trans" here are the two that matter # in practice, "rep_mean" and "rep_end" are set the same way. See the # increment vignette for the formulae. inv_increment_repsurv_ccirc( inv_a, inv_b, inv_a_trees, inv_b_trees, match_type = "plot_id", plot_id_style = "baysf", method = "rep_trans" )inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # The two match types. "center_coord" pairs plots by their centres within # a tolerance, "plot_id" by their identifiers. inv_increment_repsurv_ccirc( inv_a, inv_b, inv_a_trees, inv_b_trees, match_type = "center_coord", coord_tolerance = 10, method = "rep_classic" ) # The four methods differ only in how the increment of a single tree is # formed; "rep_classic" above and "rep_trans" here are the two that matter # in practice, "rep_mean" and "rep_end" are set the same way. See the # increment vignette for the formulae. inv_increment_repsurv_ccirc( inv_a, inv_b, inv_a_trees, inv_b_trees, match_type = "plot_id", plot_id_style = "baysf", method = "rep_trans" )
Covers the whole chain from a prepared tree list to a ready-to-aggregate
increment result. It is the yield-table counterpart of
inv_increment_repeated_survey and
inv_increment_gnfi3: all three return an object of class
fe_increment, carry their report header in meta, and are
consumed the same way.
inv_increment_ytables( inv, inv_trees, ytable_selection, plot_area_weight = TRUE )inv_increment_ytables( inv, inv_trees, ytable_selection, plot_area_weight = TRUE )
inv |
An |
inv_trees |
Tree data frame as pulled from |
ytable_selection |
A data frame that assigns names of existing
|
plot_area_weight |
Logical, if TRUE (default), the single plots are weighted with the area they represent. If FALSE all plots are equally weighted. |
The symmetry stops where the method does. A yield-table increment is not estimated per tree but for a cohort: one species in the main stand of one inventory plot, on the ideal (virtual monospecific) area it occupies there. The estimate needs the cohort's age and its mean height, which give the site index; age and site index give the per-hectare increment of the yield table, which is then corrected by the stocking level (the cohort's basal area over the basal area the table expects). Consequently this bundle holds no per-tree increments, the method is confined to the main stand, and the class tables cannot be filtered to arbitrary collectives the way the per-tree strands can.
A cohort has one age and one quadratic mean diameter, so the class an
evaluation is grouped by – age class or diameter class – is a label
on the result, not part of the estimate. Both labels are carried, and
increment_ytables_base_table groups by whichever is asked for
without estimating anything again.
An object of class fe_increment_ytables, which inherits from
fe_increment. A list with the elements
one row per inventory plot and species: age, quadratic mean diameter and height, ideal area, site index, stocking level and the annual increment. This is the estimate itself,
the species-group overview of the whole inventory,
the figures the reports print in their header,
the yield tables actually used, per species group,
the collective descriptor, always the main stand.
increment_ytables_base_table for the class tables,
output_increment_overview_ytables_pdf for the overview
report, inv_increment_gnfi3 for the per-tree single-inventory
counterpart.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inc <- inv_increment_ytables( inv = data_ex3_sample_fe_inventory, inv_trees = data_ex3_sample_trees_essentials, ytable_selection = ytables_bavrn_state_var_1_feneu ) inc inc$overviewinc <- inv_increment_ytables( inv = data_ex3_sample_fe_inventory, inv_trees = data_ex3_sample_trees_essentials, ytable_selection = ytables_bavrn_state_var_1_feneu ) inc inc$overview
Convenience helper that extracts the survey years of two
fe_inventory objects and returns them together with the
resulting inter-survey period, after the same validation that
inv_increment_repsurv_ccirc applies. Used by functions that
combine two inventories so that downstream consumers (e.g.
inv_inc_summaric) can access the period without having to
carry the fe_inventory objects further.
inv_period(inv_1st, inv_2nd)inv_period(inv_1st, inv_2nd)
inv_1st, inv_2nd
|
Two |
A list with elements time_yr_1st, time_yr_2nd,
and period_yr (the difference).
inv_period( data_ex3_previous_sample_fe_inventory, data_ex3_sample_fe_inventory )inv_period( data_ex3_previous_sample_fe_inventory, data_ex3_sample_fe_inventory )
Derive the enterprise-level figures that the meta block of the static table
PDFs (output_base_table_pdf,
output_structure_table_pdf) displays: the inventory year, the
total (represented) area, and the number of inventory points. The result is
returned in exactly the list(year, area_ha, n_plots) shape those
functions expect for their meta argument (and their inventory
argument uses this function internally).
inventory_meta(x)inventory_meta(x)
x |
A |
The figures are read off the whole fe_inventory object, which
is the authoritative plot list - so treeless plots (and their area) are
counted too, unlike a derivation from an already-filtered tree table. This
mirrors how the increment tables derive their header meta from the second
inventory.
A named list with three elements: year (the survey year; the
most recent one if the plots carry more than one, with a warning),
area_ha (sum of the per-plot represented areas), and n_plots
(number of inventory points).
inventory_meta(data_ex3_sample_fe_inventory)inventory_meta(data_ex3_sample_fe_inventory)
Test for the Class fe_increment_gnfi3
is_fe_increment_gnfi3(x)is_fe_increment_gnfi3(x)
x |
An object |
TRUE if x is an fe_increment_gnfi3 object,
FALSE otherwise
inc <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) is_fe_increment_gnfi3(inc)inc <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) is_fe_increment_gnfi3(inc)
Is an Object an fe_increment_repsurv?
is_fe_increment_repsurv(x)is_fe_increment_repsurv(x)
x |
Object to test. |
Logical.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
is_fe_increment_repsurv(1L)is_fe_increment_repsurv(1L)
Test for the Class fe_increment_ytables
is_fe_increment_ytables(x)is_fe_increment_ytables(x)
x |
An object |
TRUE if x is an fe_increment_ytables object,
FALSE otherwise
inc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) is_fe_increment_ytables(inc)inc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) is_fe_increment_ytables(inc)
Check if an Object is an fe_inventory
is_fe_inventory(x)is_fe_inventory(x)
x |
an object |
TRUE if the object inherits from the fe_stand class
is_fe_inventory(data_ex4_sample_fe_inventory)is_fe_inventory(data_ex4_sample_fe_inventory)
Wraps the functions match_2_inventories_by_center_coord, and
match_2_inventories_by_plot_id and decides which one to call.
match_2_inventories( inv_a, inv_b, match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), coord_tolerance = 10 )match_2_inventories( inv_a, inv_b, match_type = c("plot_id", "center_coord"), plot_id_style = c("baysf", "generic"), coord_tolerance = 10 )
inv_a |
An object of class |
inv_b |
An object of class |
match_type |
Character string indicating the method for matching
inventory plots from the two subsequent inventories. The option
"center_coord" matches points whose center coordinates have a distance of
no more than |
plot_id_style |
Character string indicating the plot_id style to be
used. Only relevant when |
coord_tolerance |
Maximum distance allowed for a match of two inventory
plots in the distance unit of the coordinate reference system of
|
A list with five elements: i) matches – the matching
inventory plots, ii) in_a_only – plots that exist in inv_a
only, iii) in_b_only – plots that exist in inv_b only,
iv) multiple_matches – a logical vector identifying multiple
matches (can only occur with match_type = "center_coord" and is
undesired), and v) circle_def_mismatch – plot pairs that matched
by id or coordinates but were excluded because their circle definitions
(dbh_lower and/or c_area) differ between the two inventories.
Such pairs are unsuitable for tree-level increment calculations from
repeated surveys. The exact types of the objects (tibbles or sf) in this
list depend on the match_type the function has been called with,
but they always contain a column with the relevant plot ids.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # both options for match_type work for this example match_2_inventories(inv_a, inv_b, match_type = "plot_id", "baysf") match_2_inventories(inv_a, inv_b, match_type = "center_coord", "baysf")inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # both options for match_type work for this example match_2_inventories(inv_a, inv_b, match_type = "plot_id", "baysf") match_2_inventories(inv_a, inv_b, match_type = "center_coord", "baysf")
From two fe_inventory objects identify the matching and non-
matching inventory plots based on their center coordinates. A warning is
issued if the matching coordinates indicate spatial one-to-many or
many-to-many relationships.
match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 0)match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 0)
inv_a |
An object of class |
inv_b |
An object of class |
tolerance |
Maximum distance allowed for a match of two inventory plots
in the distance unit of the coordinate reference system of |
A list containing three sf objects, matches,
in_a_only, and in_b_only, and one logical vector
multiple_matches. The three sf objects indicate the
inventory plots that are present in both, inv_a and inv_b,
only in inv_a but not in inv_b, and only in inv_b but
not in inv_a, respectively. The sf object matches has
the columns plot_id.inv_a, plot_id.inv_b, and geometry
(i.e. the point coordinates). Thereby, The column plot_id_inv_a
contains the id of a plot it has in inv_a, and analogously with
plot_id_inv_b. Note that spatially matching points do not
necessarily need to have the same plot_id in both inventories. The
sf object in_a_only has only two columns, plot_id, and
geometry. The same applies to the sf object in_b_only.
the plot_id entries for the other inventories are NA. The vector
multiple_matches relates to the matches object, and
indicates entries with the same center coordinates. This indicates
one-to-many or many-to-many relations between the two input inventories
which is usually a problem. Therefore, multiple_matches should
only contain FALSE entries.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
# Construct a dummy example with partly non-matching plots from one # fe_inventory object inv_a <- data_ex3_sample_fe_inventory[3:10, ] inv_b <- data_ex3_sample_fe_inventory[1:7, ] # As both dummy inventories were generated from the same set, we do not # require any tolerance > 0 match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 0) # Now a real example from two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Requires a tolerance of 10.0 m in order to obtain the correct match # (as indicated by the plot ids) match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 10.0) # If tolerance is set too high (here unrealistic 3000 m for demo purposes), # we obtain duplicate matches and a warning message match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 3000)# Construct a dummy example with partly non-matching plots from one # fe_inventory object inv_a <- data_ex3_sample_fe_inventory[3:10, ] inv_b <- data_ex3_sample_fe_inventory[1:7, ] # As both dummy inventories were generated from the same set, we do not # require any tolerance > 0 match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 0) # Now a real example from two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Requires a tolerance of 10.0 m in order to obtain the correct match # (as indicated by the plot ids) match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 10.0) # If tolerance is set too high (here unrealistic 3000 m for demo purposes), # we obtain duplicate matches and a warning message match_2_inventories_by_center_coord(inv_a, inv_b, tolerance = 3000)
From two fe_inventory objects identify the matching and non-
matching inventory plots based on their center coordinates.
match_2_inventories_by_plot_id(inv_a, inv_b, style = c("generic", "baysf"))match_2_inventories_by_plot_id(inv_a, inv_b, style = c("generic", "baysf"))
inv_a |
An object of class |
inv_b |
An object of class |
style |
Character, two options "generic" and "baysf". The former
requires that the column |
A list that comprises three data frames (tibbles): The first one,
matches, has two columns, plot_id_inv_a, and
plot_id_inv_b which indicate the ids of the matching plot_ids
in both inventories. The two columns are required because there may be
situations (BaySF style) where the ids of matching points are not entirely
the same. The second data frame, in_a_only, contains the ids of
those plots that exist in inv_a, but not in inv_b, while the
third one, in_b_only, contains the ids of the plots that are present
in inv_b, but not in inv_a.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
# Construct a dummy example with partly non-matching plots from one # fe_inventory object inv_a <- data_ex3_sample_fe_inventory[3:10, ] inv_b <- data_ex3_sample_fe_inventory[1:7, ] # These are BaySF style inventory data, which means that even matching plot # ids from subsequent inventories are equal only with regard to their last # group of digits. However, as this example was constructed from only one # inventory, both style options, "baysf" and "generic" are equally ok. match_2_inventories_by_plot_id(inv_a, inv_b, style = "baysf") match_2_inventories_by_plot_id(inv_a, inv_b, style = "generic") # Now a real example with two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # These are BaySF style inventory data, from real subsequent inventories. # Therefore, we must choose that style for matching match_2_inventories_by_plot_id(inv_a, inv_b, style = "baysf") # The generic inventory style requires that corresponding plots have the # same plot_id in both inventories. We can achieve that with a slight # manipulations of the BaySF style data used above (i.e. reducing the # original plot_ids to the last group of digits): inv_a <- inv_a |> dplyr::mutate( plot_id = purrr::map_chr( plot_id, .f = function(.x) strsplit(.x, "_")[[1]][3] ) ) inv_b <- inv_b |> dplyr::mutate( plot_id = purrr::map_chr( plot_id, .f = function(.x) strsplit(.x, "_")[[1]][3] ) ) # Now we achieve the same result as above with generic-style matching match_2_inventories_by_plot_id(inv_a, inv_b, style = "generic")# Construct a dummy example with partly non-matching plots from one # fe_inventory object inv_a <- data_ex3_sample_fe_inventory[3:10, ] inv_b <- data_ex3_sample_fe_inventory[1:7, ] # These are BaySF style inventory data, which means that even matching plot # ids from subsequent inventories are equal only with regard to their last # group of digits. However, as this example was constructed from only one # inventory, both style options, "baysf" and "generic" are equally ok. match_2_inventories_by_plot_id(inv_a, inv_b, style = "baysf") match_2_inventories_by_plot_id(inv_a, inv_b, style = "generic") # Now a real example with two subsequent inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # These are BaySF style inventory data, from real subsequent inventories. # Therefore, we must choose that style for matching match_2_inventories_by_plot_id(inv_a, inv_b, style = "baysf") # The generic inventory style requires that corresponding plots have the # same plot_id in both inventories. We can achieve that with a slight # manipulations of the BaySF style data used above (i.e. reducing the # original plot_ids to the last group of digits): inv_a <- inv_a |> dplyr::mutate( plot_id = purrr::map_chr( plot_id, .f = function(.x) strsplit(.x, "_")[[1]][3] ) ) inv_b <- inv_b |> dplyr::mutate( plot_id = purrr::map_chr( plot_id, .f = function(.x) strsplit(.x, "_")[[1]][3] ) ) # Now we achieve the same result as above with generic-style matching match_2_inventories_by_plot_id(inv_a, inv_b, style = "generic")
match_2_inventories
Informs about the numbers of plots that match and do not match in both inventories, and the corresponding representation areas in ha.
match_plot_statistics(plot_matches, inv_a, inv_b)match_plot_statistics(plot_matches, inv_a, inv_b)
plot_matches |
list, output of |
inv_a |
An object of class |
inv_b |
An object of class |
A list containing two named vectors, plot_numbers, and
rep_areas_ha. These contain the statistics relating to plot numbers
and represented areas, respectively. Both include a count/area for
plots excluded due to incompatible circle definitions
(n_circle_def_mismatch, ha_circle_def_mismatch_1st,
ha_circle_def_mismatch_2nd).
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # both options for match_type work for this example match_pid <- match_2_inventories( inv_a, inv_b, match_type = "plot_id", "baysf" ) match_crd <- match_2_inventories( inv_a, inv_b, match_type = "center_coord", "baysf" ) # stats should be the same in both cases match_plot_statistics(match_pid, inv_a, inv_b) match_plot_statistics(match_crd, inv_a, inv_b)inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # both options for match_type work for this example match_pid <- match_2_inventories( inv_a, inv_b, match_type = "plot_id", "baysf" ) match_crd <- match_2_inventories( inv_a, inv_b, match_type = "center_coord", "baysf" ) # stats should be the same in both cases match_plot_statistics(match_pid, inv_a, inv_b) match_plot_statistics(match_crd, inv_a, inv_b)
Typically called from within inv_increment_repsurv_ccirc. The
consistency of the input to this function is not checked here. In essence,
the function wraps serial calls of
match_trees_on_plot_repsurv_ccirc.
match_trees_on_inventory_repsurv_ccirc( inv_point_matches, inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), progress_bar = TRUE )match_trees_on_inventory_repsurv_ccirc( inv_point_matches, inv_1st, inv_2nd, inv_1st_trees, inv_2nd_trees, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE, shrinkage_rate_per_decade = 0.1, species_check = c("species_group", "species", "warn_only"), progress_bar = TRUE )
inv_point_matches |
Output of |
inv_1st |
|
inv_2nd |
|
inv_1st_trees |
A data frame resulting from applying the functions
|
inv_2nd_trees |
A data frame resulting from applying the functions
|
tree_id_style |
Character string that indicates how trees are uniquely identified on inventory plot level. This is required for matching trees on the same plot in both inventories. The options are "baysf" (default) and "generic". In the BaySF case, trees are matched by their polar coordinates, while in the generic case, the tree_ids must mark the same trees in both inventories. |
inner_circle_non_matchable |
Logical, default |
shrinkage_rate_per_decade |
Numeric, the maximum plausible volume
shrinkage rate per decade. Default is |
species_check |
Character string controlling species consistency
checks. Options: |
progress_bar |
Boolean, if |
A data frame identifying all matching trees with their tree and
plot ids in both inventories, the calendar years of both inventories,
and columns with flags that indicate in which of both inventories
a tree exists (can be only one of them or both). Additionally contains
the columns volume_change_rate_per_decade (the observed volume
change rate scaled to a decade, based on an exponential model; positive
values indicate growth, negative values indicate shrinkage),
volume_change_implausible (logical, TRUE if shrinkage
exceeds the threshold), and species_mismatch (logical,
TRUE if species identity changed between surveys according to
the species_check setting).
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_plot_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_plot_repsurv_ccirc()
# Prepare everything required inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Match inventory points inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Finally, make the match match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" )# Prepare everything required inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Match inventory points inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Finally, make the match match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" )
Identifying trees that do or do not occur in two subsequent observations of
one inventory plot of class
fe_ccircle_spatial. Takes into account only
trees with an entry in the tree_positions slot of the
fe_ccircle_spatial object. Trees that have
a removal flag in the first observation are excluded, because they are not
relevant for increment calculations.
match_trees_on_plot_repsurv_ccirc( plot_in_inv_1st, plot_in_inv_2nd, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE )match_trees_on_plot_repsurv_ccirc( plot_in_inv_1st, plot_in_inv_2nd, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE )
plot_in_inv_1st |
An inventory plot represented as an object of class
|
plot_in_inv_2nd |
An inventory plot representing a later survey of plot
|
tree_id_style |
Character string that indicates how trees are uniquely identified on inventory plot level. This is required for matching trees on the same plot in both inventories. The options are "baysf" (default) and "generic". In the BaySF case, trees are matched by their polar coordinates, while in the generic case, the tree_ids must mark the same trees in both inventories. |
inner_circle_non_matchable |
Logical, default |
Typically called from within
match_trees_on_inventory_repsurv_ccirc which in turn is called
by inv_increment_repsurv_ccirc.
The function does not check whether the two input inventory plots
(plot_in_inv_1st, plot_in_inv_2nd) are really matching, i.e.
represent two subsequent surveys of the same plot. This must be made sure
before calling it.
A data frame with seven columns, tree_id_1st,
tree_id_2nd, tree_exists_1st, tree_exists_2nd,
time_yr_1st, and time_yr_2nd. The first two contain the ids
of the plot and the matching trees in the first inventory. If a tree is not
present in one inventory, its id value is NA. Similarly, the third
and the fourth column have the value TRUE or FALSE if a tree
exists in an inventory or not. The column tree_removal_2nd indicates
whether a tree has been registed as removed (TRUE) or not
(FALSE) in the second inventory.
The tree_id and the tree_exists columns are somewhat redundant, but their
different formats may be useful in subsequent evaluations. The sixth and
the seventh column contain the years of both inventories. These two columns
do never have NA values.
With tree_id_style == "baysf" trees are matched on their exact
polar coordinates. If two trees of the same plot and survey carry the
same distance and azimuth, that position identifies neither of them, and
an exact-coordinate join would pair every inv-1 tree at the spot with
every inv-2 tree at the spot — a Cartesian product that lets a tree enter
the increment more than once.
The rule is therefore: a position shared by more than one tree of
the same plot and survey is treated as no position at all. The affected
trees are handled exactly like trees recorded without coordinates — they
are excluded from the match and flagged is_unmatchable_1st resp.
is_unmatchable_2nd. Their measured volumes still reach the
standing-volume aggregates, they simply contribute no individual
increment, and they never become pseudo-ingrowth candidates (their
tree_exists_* stays NA). Each occurrence raises a warning
naming the plot and the trees.
Duplicated coordinates are a defect of the source data, not a modelling choice, and they are rare (single-digit counts per real inventory). This rule keeps the increment computation well-defined and conservative rather than resolving the ambiguity by guessing which tree is which.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
reclassify_pseudo_ingrowth_ccirc()
Other inventory matches:
harmonize_inv_for_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc()
# Standard case: Match two single plots, both with the same set of trees ## Select two matching plots from two subsequent inventories plot_1st <- data_ex3_previous_sample_fe_inventory |> dplyr::filter(plot_id == "900100002_1_99900002") |> purrr::pluck("plot", 1) plot_2nd <- data_ex3_sample_fe_inventory |> dplyr::filter(plot_id == "900000002_1_99900002") |> purrr::pluck("plot", 1) ## Here's the actual matching match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) # Standard case: Match two single plots, some trees however missing in # the first or the second inventory ## Construct the data from the example above by clipping out trees from ## plot_1st plot_2nd <- plot_1st miss_index <- c(1, 2, 4, 5) plot_1st$trees <- plot_1st$trees |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) plot_1st$tree_positions <- plot_1st$tree_positions |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) miss_index <- c(3, 7, 8) plot_2nd$trees <- plot_2nd$trees |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) plot_2nd$tree_positions <- plot_2nd$tree_positions |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" ) # Special case: First survey has no trees (all ingrowth) ## Construct an artifical example plot_1st <- ForestElementsR::spruce_pine_ccircle_spatial_notrees plot_2nd <- ForestElementsR::spruce_pine_ccircle_spatial ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" ) # Special case: Second survey has no trees (all felled) ## Construct an artifical example plot_1st <- ForestElementsR::spruce_pine_ccircle_spatial plot_2nd <- ForestElementsR::spruce_pine_ccircle_spatial_notrees ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" )# Standard case: Match two single plots, both with the same set of trees ## Select two matching plots from two subsequent inventories plot_1st <- data_ex3_previous_sample_fe_inventory |> dplyr::filter(plot_id == "900100002_1_99900002") |> purrr::pluck("plot", 1) plot_2nd <- data_ex3_sample_fe_inventory |> dplyr::filter(plot_id == "900000002_1_99900002") |> purrr::pluck("plot", 1) ## Here's the actual matching match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) # Standard case: Match two single plots, some trees however missing in # the first or the second inventory ## Construct the data from the example above by clipping out trees from ## plot_1st plot_2nd <- plot_1st miss_index <- c(1, 2, 4, 5) plot_1st$trees <- plot_1st$trees |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) plot_1st$tree_positions <- plot_1st$tree_positions |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) miss_index <- c(3, 7, 8) plot_2nd$trees <- plot_2nd$trees |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) plot_2nd$tree_positions <- plot_2nd$tree_positions |> dplyr::arrange(tree_id) |> dplyr::slice(- miss_index) ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" ) # Special case: First survey has no trees (all ingrowth) ## Construct an artifical example plot_1st <- ForestElementsR::spruce_pine_ccircle_spatial_notrees plot_2nd <- ForestElementsR::spruce_pine_ccircle_spatial ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" ) # Special case: Second survey has no trees (all felled) ## Construct an artifical example plot_1st <- ForestElementsR::spruce_pine_ccircle_spatial plot_2nd <- ForestElementsR::spruce_pine_ccircle_spatial_notrees ## Matching works with both styles in this example match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "baysf" ) match_trees_on_plot_repsurv_ccirc( plot_1st, plot_2nd, tree_id_style = "generic" )
Format Base Tables for Output (Basistabellen)
output_base_table(base_table)output_base_table(base_table)
base_table |
the output from either
|
A data frame containing aggregated information by species group, classified by age or dq class (rows)
The returned object carries a class_type attribute ("age" or
"dq") recording its class axis, and propagates the
tree_selection attribute set by the *_table_*() functions.
output_base_table_pdf /
output_structure_table_pdf read both (via the internal helper
.table_pdf_meta) instead of taking a type or a cohort/layer
argument.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. trees_complete <- data_ex3_sample_trees_essentials base_table <- trees_complete |> base_table_age_class_main_stand() base_table |> output_base_table()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. trees_complete <- data_ex3_sample_trees_essentials base_table <- trees_complete |> base_table_age_class_main_stand() base_table |> output_base_table()
Transform an inventory output base table as generated by
output_base_table into a pdf file that can be exported or
displayed.
output_base_table_pdf( x, tab_title, output_dir = NA, meta = NULL, inventory = NULL, language = c("ger") )output_base_table_pdf( x, tab_title, output_dir = NA, meta = NULL, inventory = NULL, language = c("ger") )
x |
Input object, must be an output base table as generated with
|
tab_title |
Character, used for the table title and the file name. |
output_dir |
Path to the directory where the information sheet will be stored in. Default is NA; in this case, the file will be written into the temporary directory of the current R session. This directory will, however, only available as long as the session is going on. |
meta |
Optional named list with inventory meta-information to display
above the table. Recognised names: |
inventory |
Optional |
language |
Language of the rendered output. Currently only
|
The user must make sure that the input object x has been generated with
output_base_table, because the function does not check that.
For other objects the function will either produce an error or at least
strange results.
The file name is assembled as
output_base_table_ger_<tab_title>_<type>_<cohort>.pdf. The
<cohort> tag identifies the tree cohort the table represents and is
taken from the tag the base_table_*() functions attach to their
result ("mainstand" for the *_main_stand() functions,
"alllayers" for the general functions called with their default
tree_filter, or a sanitised form of a custom tree_filter
expression). This keeps the four standard variants (main stand / all layers
age / diameter classes) in separate, self-describing files
instead of overwriting one another.
The class axis (<type>, age or dq) is likewise read off the object
(the class_type attribute stamped by output_base_table),
and the same cohort tag also selects the disclaimer note below the table
(main-stand note, all-layers note, or - for a custom tree_filter -
a plain "Benutzerdefinierte Auswahl" subtitle without a note). Neither is a
function argument any longer, so they can no longer be set inconsistently
with the actual table content.
The path to the rendered pdf file
The stages that produce this function's input:
output_base_table, fed by one of the four base tables
base_table_age_class,
base_table_age_class_main_stand,
base_table_d_q_class, and
base_table_d_q_class_main_stand. The structure-table
counterpart of this function is output_structure_table_pdf.
Other pdf_output:
check_pdf_dependencies(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# Build the table (the species cast warnings are a natural side effect of # the required species grouping) base_tab <- data_ex3_sample_trees_essentials |> base_table_age_class_main_stand() |> output_base_table() # Render it; output_dir defaults to tempdir(), which is what we want here pdf_path <- output_base_table_pdf(base_tab, "example_ex3") basename(pdf_path)# Build the table (the species cast warnings are a natural side effect of # the required species grouping) base_tab <- data_ex3_sample_trees_essentials |> base_table_age_class_main_stand() |> output_base_table() # Render it; output_dir defaults to tempdir(), which is what we want here pdf_path <- output_base_table_pdf(base_tab, "example_ex3") basename(pdf_path)
Increment counterpart of output_base_table. It restructures the
four-element increment base table into the same display layout (variables to
rows, age or diameter classes to columns, plus the appended “Summe”
cross-species block) used for the static base tables.
output_increment_base_table(increment_base_table)output_increment_base_table(increment_base_table)
increment_base_table |
the output from either
|
Because the increment base tables share the exact four-element layout
(list(detail, total, all_species, all_total)) and the same
species_group / class-column convention as the static ones, this
function reuses the generic restructuring of output_base_table.
It is exposed as its own increment-family entry point so the increment output
API stays discoverable and can diverge later (e.g. combining a value with its
confidence interval) without touching the static side.
A data frame with one row per species group and variable, the class
levels as columns plus a total column, and the cross-species
“Summe” block appended at the bottom (tagged with an NA
species_group). The input's collective descriptor and its
meta element are carried through as "collective" and
"meta" attributes on the returned data frame, so the PDF step can
label the collective (Hauptbestand / Alle Schichten / custom) and fill the
header meta block without re-deriving them from the columns.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) # Plain and main-stand increment base tables, restructured for output increment_base_table(inc, by_class = "age") |> output_increment_base_table() increment_base_table_main_stand(inc, by_class = "age") |> output_increment_base_table()inv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) # Plain and main-stand increment base tables, restructured for output increment_base_table(inc, by_class = "age") |> output_increment_base_table() increment_base_table_main_stand(inc, by_class = "age") |> output_increment_base_table()
Increment counterpart of output_base_table_pdf. Turns the
restructured increment base table from output_increment_base_table
into a formatted PDF, using the unified header (Forstbetrieb name, collective
line, meta line) modelled on the increment overview PDFs.
output_increment_base_table_pdf( x, tab_title, type = c("age", "dq"), output_dir = NA, meta = NULL, collective = NULL, ytables_used = NULL, language = c("ger") )output_increment_base_table_pdf( x, tab_title, type = c("age", "dq"), output_dir = NA, meta = NULL, collective = NULL, ytables_used = NULL, language = c("ger") )
x |
Input object, the output of |
tab_title |
Character; the Forstbetrieb (or collective) name shown prominently in the header and used for the file name. |
type |
Character, |
output_dir |
Path to the directory the PDF is written to. Default
|
meta |
Optional named list with inventory meta-information for the header
meta block. Recognised names: |
collective |
Optional collective descriptor list
( |
ytables_used |
Optional data frame of the yield tables used (columns
|
language |
Language of the rendered output. Currently only |
The header is built in four parts: the table title, the prominent
Forstbetrieb name (tab_title) right below it, and a flushleft meta
block modelled on the “Zuwachs auf Betriebsebene” overview PDF – a
collective line (“Hauptbestand” / “Alle Schichten” /
“Benutzerdefiniertes Kollektiv: ...”) taken from the table's
collective descriptor, followed by the inventory meta (year, area,
point count and, for repeated inventories, the previous inventory year,
period, Berechnungsmethode and Ergänzungsmethode). A footnote states
whether the table is restricted to the main stand (a partial collective that
allows virtual per-species hectare areas) or not.
The user must make sure that x was produced by
output_increment_base_table; the function does not check that.
The path to the rendered PDF file.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# A gnfi3 increment of the ex3 inventory; the ready-made tree list is # shipped with the package, so the height chain does not have to be run inc <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) bt <- increment_base_table_main_stand(inc, by_class = "age") |> output_increment_base_table() # output_dir defaults to tempdir() pdf_path <- output_increment_base_table_pdf( bt, tab_title = "Forstbetrieb Beispiel", meta = list(year = 2024, area_ha = 1234, n_plots = 42) ) basename(pdf_path)# A gnfi3 increment of the ex3 inventory; the ready-made tree list is # shipped with the package, so the height chain does not have to be run inc <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) bt <- increment_base_table_main_stand(inc, by_class = "age") |> output_increment_base_table() # output_dir defaults to tempdir() pdf_path <- output_increment_base_table_pdf( bt, tab_title = "Forstbetrieb Beispiel", meta = list(year = 2024, area_ha = 1234, n_plots = 42) ) basename(pdf_path)
Companion to inv_inc_big_overview: takes its rich
multi-list output and produces a render-ready intermediate object that
downstream functions (output_increment_overall_pdf, Shiny
tables, csv exports) can consume without redoing the restructuring.
output_increment_overall( bo, fill_option = c("standard", "min_estimates", "all_estimates"), user_subtitle = NULL )output_increment_overall( bo, fill_option = c("standard", "min_estimates", "all_estimates"), user_subtitle = NULL )
bo |
Either an |
fill_option |
Which matched fill_option to display in the
"Single-tree based" block of |
user_subtitle |
Optional character giving an extra subtitle for
the output (e.g. |
The intermediate object collects three parallel tables – one for
matched plots, one for second-only plots, one for the combined
enterprise view – with identical column shape. This lets the renderer
stack them vertically with column-aligned numbers. CI95 columns are
present in all three tables but only filled for the matches_only
table; the gnfi3-based second_only and combined contributions stay
empty by contract (NA) because their per-plot scatter is a
model artefact and an empirical CI would mislead.
Language is deliberately a render-time concern, not a
restructuring-time one: the species_group column is passed
through as the original fe_species_* S3 vector, and the
rendering layer (output_increment_overall_pdf or any
alternative consumer) sets options(fe_spec_lang = ...) plus
format() to choose the display language. This keeps the
intermediate object reusable for multi-language exports from the
same data.
A list with the elements:
A list with title (named character vector
indexed by language code), user_subtitle,
method (the increment method, pulled from bo$method),
fill_option, inv_year_prev, inv_year_curr,
period_yr, and plot_match_stats (a list with
n_total_2nd, n_matched, n_2nd_only,
area_total_2nd_ha, area_matched_ha,
area_2nd_only_ha).
One row per species_group plus a summary row
(is_total_row = TRUE), with the eight numeric columns
described below.
Same column shape as table_matched.
The "Single-tree based" block holds the gnfi3-backward
estimate; the "Summaric" block is all NA (there is no
yield-history balance for plots with only one observation).
Same column shape; columns hold the
per-row sum of table_matched and table_2nd_only.
All CI95 columns are NA.
The eight numeric columns in each table:
iv_m3_yr_total_st, ci95_iv_m3_yr_total_st,
iv_m3_ha_yr_st, ci95_iv_m3_ha_yr_st for the
single-tree block; suffix _sum (for "summaric") on the same
four for the yield-history block.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# Matching and gap filling of the ex3 pair are shipped ready-made, so the # overall figures can be built without running the whole chain first. inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) out <- output_increment_overall( bo, fill_option = "standard", user_subtitle = "Forstbetrieb Neustadt" ) str(out, max.level = 2)# Matching and gap filling of the ex3 pair are shipped ready-made, so the # overall figures can be built without running the whole chain first. inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) out <- output_increment_overall( bo, fill_option = "standard", user_subtitle = "Forstbetrieb Neustadt" ) str(out, max.level = 2)
Thin wrapper around rmarkdown::render() that turns the
restructured intermediate from output_increment_overall into a
nicely formatted PDF. The intermediate's meta block drives the
title, survey-year line, plot-match summary, and the fill_option
subtitle; the three tibbles (table_matched,
table_2nd_only, table_combined) are rendered stacked
below with shared column shape and decimal-point-bound numbers.
output_increment_overall_pdf(x, output_dir = NA, language = c("ger"))output_increment_overall_pdf(x, output_dir = NA, language = c("ger"))
x |
Input object, must be the output of
|
output_dir |
Path to the directory where the PDF will be
written. Default |
language |
Language of the rendered output. Currently only
|
The user must make sure that the input object x has been
generated with output_increment_overall; the function does
not check that. Other objects will either produce an error or
strange results.
The path to the rendered PDF file.
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
# See output_increment_overall() for what the intermediate is built from; # matching and gap filling of the ex3 pair are shipped ready-made. inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) out <- output_increment_overall( bo, fill_option = "standard", user_subtitle = "Forstbetrieb Neustadt" ) # output_dir defaults to tempdir() pdf_path <- output_increment_overall_pdf(out) basename(pdf_path)# See output_increment_overall() for what the intermediate is built from; # matching and gap filling of the ex3 pair are shipped ready-made. inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inc_rep <- data_ex3_increment_matched inc_fl <- data_ex3_increment_fills inc_sum <- inv_inc_summaric( inc_rep$tree_increments, inc_fl$fills_forward, inv_a_trees, inv_b_trees ) bo <- inv_inc_big_overview( inc_fl, inv_a_trees, inv_b_trees, inv_b, style = "generic", inc_summaric = inc_sum ) out <- output_increment_overall( bo, fill_option = "standard", user_subtitle = "Forstbetrieb Neustadt" ) # output_dir defaults to tempdir() pdf_path <- output_increment_overall_pdf(out) basename(pdf_path)
Builds the species-level increment overview for the increment estimated from
a single inventory with the tree growth functions of the Third German
National Forest Inventory (gnfi3). The layout corresponds to table B of
output_increment_overall: one row per species group plus a total row,
each carrying the annual volume increment as an absolute total
(zv_m3_yr) and per hectare (zv_m3_ha_yr). Confidence intervals
are not reported here – consistent with the package-wide convention that the
gnfi3 estimate carries no empirical confidence interval (unlike the repeated
survey).
output_increment_overview_gnfi3(increment_base_table)output_increment_overview_gnfi3(increment_base_table)
increment_base_table |
A gnfi3 increment base table, the output of
|
Like the increment base tables, this is the language-neutral intermediate;
species_group stays an fe_species_* vector so the render step
decides the language. The table's collective descriptor is carried
through as a "collective" attribute.
A tibble with one row per species group plus a total row, the
columns species_group, is_total_row, zv_m3_yr and
zv_m3_ha_yr, and a "collective" attribute carried over from
the input.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
inv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) increment_base_table(inc, by_class = "age") |> output_increment_overview_gnfi3()inv_b <- data_ex3_sample_fe_inventory inv_b_trees <- data_ex3_sample_trees_essentials inc <- inv_increment_gnfi3(inv_b, inv_b_trees) increment_base_table(inc, by_class = "age") |> output_increment_overview_gnfi3()
Renders the overview from output_increment_overview_gnfi3 as a
PDF, using the unified header (Forstbetrieb name, collective line, meta line)
of the increment table PDFs. The German heading names the method in full
(“Zuwachsfunktionen der 3. Bundeswaldinventur”); a footnote states
that all volume figures are harvested volume under bark (Erntefestmeter ohne
Rinde).
output_increment_overview_gnfi3_pdf( x, tab_title, output_dir = NA, meta = NULL, collective = NULL, language = c("ger") )output_increment_overview_gnfi3_pdf( x, tab_title, output_dir = NA, meta = NULL, collective = NULL, language = c("ger") )
x |
The output of |
tab_title |
Character; the Forstbetrieb name shown prominently in the header and used for the file name. |
output_dir |
Path to the directory the PDF is written to. Default
|
meta |
Optional named list with header meta-information ( |
collective |
Optional collective descriptor overriding the one carried on
|
language |
Language of the rendered output. Currently only |
The path to the rendered PDF file.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# A gnfi3 increment of the ex3 inventory; the ready-made tree list is # shipped with the package, so the height chain does not have to be run ov <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) |> increment_base_table(by_class = "age") |> output_increment_overview_gnfi3() # output_dir defaults to tempdir() pdf_path <- output_increment_overview_gnfi3_pdf( ov, tab_title = "Forstbetrieb Beispiel" ) basename(pdf_path)# A gnfi3 increment of the ex3 inventory; the ready-made tree list is # shipped with the package, so the height chain does not have to be run ov <- inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials ) |> increment_base_table(by_class = "age") |> output_increment_overview_gnfi3() # output_dir defaults to tempdir() pdf_path <- output_increment_overview_gnfi3_pdf( ov, tab_title = "Forstbetrieb Beispiel" ) basename(pdf_path)
Renders the overview of an inv_increment_ytables result as a
PDF with the unified header (Forstbetrieb name, collective line, meta line).
Two tables are shown: the species-group overview (virtual area, mean site
index, increment per ha and total) and a listing of the yield tables used per
species group. A footnote states that all volumes are harvested volume under
bark (Erntefestmeter ohne Rinde) and that the table is restricted to the main
stand.
output_increment_overview_ytables_pdf( x, tab_title, output_dir = NA, meta = NULL, language = c("ger") )output_increment_overview_ytables_pdf( x, tab_title, output_dir = NA, meta = NULL, language = c("ger") )
x |
The result of |
tab_title |
Character; the Forstbetrieb name shown prominently in the header and used for the file name. |
output_dir |
Path to the directory the PDF is written to. Default
|
meta |
Optional named list with header meta-information ( |
language |
Language of the rendered output. Currently only |
The path to the rendered PDF file.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
reclassify_pseudo_ingrowth_ccirc(),
tree_inc_repsurv()
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_structure_table_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# FeNEU's own yield-table collection covers all current bavrn_state # species codes; the ForestElementsR collection does not. inc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) # output_dir defaults to tempdir() pdf_path <- output_increment_overview_ytables_pdf( inc, tab_title = "Forstbetrieb Beispiel" ) basename(pdf_path)# FeNEU's own yield-table collection covers all current bavrn_state # species codes; the ForestElementsR collection does not. inc <- inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu ) # output_dir defaults to tempdir() pdf_path <- output_increment_overview_ytables_pdf( inc, tab_title = "Forstbetrieb Beispiel" ) basename(pdf_path)
A data frame with group-wise aggregated inventory information separated per species is returned.
output_structure_table(structure_table)output_structure_table(structure_table)
structure_table |
structure table generated from
|
A data frame containing aggregated information by species group,
separated by age or dq class (rows) and classified by single tree
diameter class (columns). When all_species is supplied, a trailing
cross-species "Summe" group (with an NA species group) is appended.
When species_total is supplied, each species' block gets its own
trailing "Summe" row (grand total across all classes and dbh classes for
that species); when species_dbh_total is also supplied, that same
row's dbh_class columns are filled with the species' per-dbh_class sums/
weighted means across all classes (mirroring BaySF's own report), rather
than being left blank. When grand_total/grand_dbh_total are
supplied, the cross-species "Summe" block gets the equivalent trailing
"Summe" row - the true grand total across every species, class, and dbh
class combined.
The returned object carries a class_type attribute ("age" or
"dq") recording its class axis, and propagates the
tree_selection attribute set by the *_table_*() functions.
output_base_table_pdf /
output_structure_table_pdf read both (via the internal helper
.table_pdf_meta) instead of taking a type or a cohort/layer
argument.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. trees_complete <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) structure_table <- trees_complete |> structure_table_age_class_main_stand() structure_table |> output_structure_table()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. trees_complete <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) structure_table <- trees_complete |> structure_table_age_class_main_stand() structure_table |> output_structure_table()
Transform an inventory output structure table as generated by
output_structure_table into a pdf file that can be exported or
displayed.
output_structure_table_pdf( x, tab_title, output_dir = NA, meta = NULL, inventory = NULL, language = c("ger") )output_structure_table_pdf( x, tab_title, output_dir = NA, meta = NULL, inventory = NULL, language = c("ger") )
x |
Input object, must be an output structure table as generated with
|
tab_title |
Character, used for the table title and the file name. |
output_dir |
Path to the directory where the information sheet will be stored in. Default is NA; in this case, the file will be written into the temporary directory of the current R session. This directory will, however, only available as long as the session is going on. |
meta |
Optional named list with inventory meta-information to display
above the table. Recognised names: |
inventory |
Optional |
language |
Language of the rendered output. Currently only
|
The user must make sure that the input object x has been generated with
output_structure_table, because the function does not check that.
For other objects the function will either produce an error or at least
strange results.
The file name is assembled as
output_structure_table_ger_<tab_title>_<type>_<cohort>.pdf. The
<cohort> tag identifies the tree cohort the table represents and is
taken from the tag the structure_table_*() functions attach to their
result ("mainstand" for the *_main_stand() functions,
"alllayers" for the general functions called with their default
tree_filter, or a sanitised form of a custom tree_filter
expression). This keeps the four standard variants (main stand / all layers
age / diameter classes) in separate, self-describing files
instead of overwriting one another.
The class axis (<type>, age or dq) is likewise read off the object
(the class_type attribute stamped by
output_structure_table), and the same cohort tag also selects
the disclaimer note (main-stand note, all-layers note, or - for a custom
tree_filter - a plain "Benutzerdefinierte Auswahl" subtitle without a
note). Neither is a function argument any longer, so they can no longer be
set inconsistently with the actual table content.
The path to the rendered pdf file
The stages that produce this function's input:
output_structure_table, fed by one of the four structure
tables structure_table_age_class,
structure_table_age_class_main_stand,
structure_table_d_q_class, and
structure_table_d_q_class_main_stand. The base-table
counterpart of this function is output_base_table_pdf.
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
pdf_dependencies,
plot_info_sheet_pdf()
# Build the table (the species cast warnings are a natural side effect of # the required species grouping) structure_tab <- data_ex3_sample_trees_essentials |> structure_table_age_class_main_stand() |> output_structure_table() # Render it; output_dir defaults to tempdir(), which is what we want here pdf_path <- output_structure_table_pdf(structure_tab, "example_ex3") basename(pdf_path)# Build the table (the species cast warnings are a natural side effect of # the required species grouping) structure_tab <- data_ex3_sample_trees_essentials |> structure_table_age_class_main_stand() |> output_structure_table() # Render it; output_dir defaults to tempdir(), which is what we want here pdf_path <- output_structure_table_pdf(structure_tab, "example_ex3") basename(pdf_path)
The *_pdf() functions in FeNEU render their tables through
rmarkdown + kableExtra on top of pandoc and a LaTeX
distribution. Pandoc and LaTeX are not R packages; they are external
tools that must be installed once per machine.
The R-side dependencies are listed as Suggests in the
FeNEU DESCRIPTION. They are not pulled in by
install.packages("FeNEU"); users who want PDF output must
install them explicitly:
install.packages(c("rmarkdown", "kableExtra", "tinytex"))
Check via rmarkdown::pandoc_available() (returns
TRUE when a usable pandoc is on the path).
RStudio bundles pandoc and rmarkdown picks it up automatically.
A standalone installer for every platform is available at
https://pandoc.org/installing.html. On macOS, also
brew install pandoc; on Debian/Ubuntu,
apt install pandoc.
The easiest path for R users is tinytex:
install.packages("tinytex")
tinytex::install_tinytex()
The second call downloads a small LaTeX distribution (~ 300 MB) to the user's home directory. From then on, missing LaTeX packages required by FeNEU's templates (siunitx, booktabs, makecell, longtable, ...) are fetched automatically when a PDF is rendered.
Alternatively, any TeX Live or MiKTeX installation works as long as those LaTeX packages are available.
To verify the environment before rendering a first PDF:
rmarkdown::pandoc_available() # pandoc on PATH?
rmarkdown::pandoc_version() # which version?
tinytex::is_tinytex() # tinytex installed?
Sys.which("pdflatex") # latex on PATH?
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
plot_info_sheet_pdf()
# See whether everything is in place to render a FeNEU PDF rmarkdown::pandoc_available() requireNamespace("kableExtra", quietly = TRUE)# See whether everything is in place to render a FeNEU PDF rmarkdown::pandoc_available() requireNamespace("kableExtra", quietly = TRUE)
Render an Information Sheet for an Inventory Plot as a PDF File
plot_info_sheet_pdf( x, title = NA, output_dir = NA, dbh_scale = 4, language = c("ger") )plot_info_sheet_pdf( x, title = NA, output_dir = NA, dbh_scale = 4, language = c("ger") )
x |
An object of class
|
title |
id or name for the title of the plot and file. Default is NA,
which means that the entry |
output_dir |
Path to the directory where the information sheet will be stored in. Default is NA; in this case, the file will be written into the temporary directory of the current R session. This directory will, however, only available as long as the session is going on. |
dbh_scale |
Factor for oversizing the trees' dbh in the plot |
language |
Language of the rendered output. Currently only
|
The path to the rendered output file
Other pdf_output:
check_pdf_dependencies(),
output_base_table_pdf(),
output_increment_base_table_pdf(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
output_structure_table_pdf(),
pdf_dependencies
# One info sheet for the first inventory point of ex3. # output_dir defaults to tempdir(). file_path <- data_ex3_sample_fe_inventory$plot[[1]] |> plot_info_sheet_pdf() basename(file_path) # Several sheets in one go (not run here -- one render per plot) # data_ex3_sample_fe_inventory$plot[1:10] |> lapply(plot_info_sheet_pdf)# One info sheet for the first inventory point of ex3. # output_dir defaults to tempdir(). file_path <- data_ex3_sample_fe_inventory$plot[[1]] |> plot_info_sheet_pdf() basename(file_path) # Several sheets in one go (not run here -- one render per plot) # data_ex3_sample_fe_inventory$plot[1:10] |> lapply(plot_info_sheet_pdf)
Print an fe_increment_gnfi3 Object
## S3 method for class 'fe_increment_gnfi3' print(x, ...)## S3 method for class 'fe_increment_gnfi3' print(x, ...)
x |
An |
... |
Other parameters (not used) |
x, invisibly
inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials )inv_increment_gnfi3( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials )
Print an fe_increment_repsurv Object
## S3 method for class 'fe_increment_repsurv' print(x, ...)## S3 method for class 'fe_increment_repsurv' print(x, ...)
x |
An |
... |
Not used. |
x, invisibly.
Print an fe_increment_ytables Object
## S3 method for class 'fe_increment_ytables' print(x, ...)## S3 method for class 'fe_increment_ytables' print(x, ...)
x |
An |
... |
Other parameters (not used) |
x, invisibly
inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu )inv_increment_ytables( data_ex3_sample_fe_inventory, data_ex3_sample_trees_essentials, ytables_bavrn_state_var_1_feneu )
Sample Inventory Trees With Estimated Heights (Bavarian)
These data is mainly provided for internal testing. It is a tibble
that has been created by applying height_complete_inventory
to the pulled tree data frame processed_pulled_sub10, with the
Bavarian standard height curve system (see
h_standard_bv).
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_nfi_sub10,
processed_pulled_sub10
Sample Inventory Trees With Estimated Heights (NFI)
These data is mainly provided for internal testing. It is a tibble
that has been created by applying height_complete_inventory
to the pulled tree data frame processed_pulled_sub10, with the
German National Forest Inventory (NFI) standard height curve system ((see
h_standard_gnfi3).
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_pulled_sub10
Example Inventory as Pulled Trees (10 inventory points)
Mainly provided for internal testing. It is a tibble that has been
created by applying pull_trees to the ten-point fe_inventory
object data_ex3_sample_fe_inventory.
Other example data:
data_ex1_sample_raw,
data_ex2_sample_raw,
data_ex3_increment_interim,
data_ex3_previous_sample_fe_inventory,
data_ex3_sample_fe_inventory,
data_ex3_trees_essentials,
data_ex4_previous_sample_fe_inventory,
data_ex4_sample_fe_inventory,
data_ex5_previous_sample_fe_inventory,
data_ex5_sample_fe_inventory,
data_ex6_standwise_fe_inventory,
data_ex7_standwise_fe_inventory,
data_examples_overview,
inc_sub10_rep_classic,
inc_sub10_rep_end,
inc_sub10_rep_mean,
inc_sub10_rep_trans,
processed_heights_bav_sub10,
processed_heights_nfi_sub10
Pull Center Point Coordinates From an fe_inventory Object
pull_centers(x)pull_centers(x)
x |
An object of class |
An object of class sf with the column plot_id as taken
from the input object x, and a geometry column that represents each
plot's center point. In case the plot column of x does not
contain objects that allow to extract meaningful center coordinates the
resulting geometry will be empty.
data_ex3_sample_fe_inventory |> pull_centers()data_ex3_sample_fe_inventory |> pull_centers()
Extracts per-plot slope and minimum circle area from the circle definition
of an fe_inventory object. Useful for reconstructing small-tree
expansion factors or for diagnostic purposes.
pull_circle_definitions(forest_inventory, .progress = TRUE)pull_circle_definitions(forest_inventory, .progress = TRUE)
forest_inventory |
Object of class |
.progress |
Logical, if TRUE a progress bar is shown. |
Tibble with one row per plot, containing at least
plot_id, slope and min_c_area.
pull_circle_definitions(data_ex3_sample_fe_inventory)pull_circle_definitions(data_ex3_sample_fe_inventory)
Basically, this function calls the function
stand_sums_static. According to the behaviour
of that function, If the height values provided with an inventory plot are
not complete, all output values that require height for calculation (i.e.
meam and dominant heights, tree volumes) will be NA.
pull_sums(forest_inventory, hd_dom_method = "Weise", .progress = TRUE)pull_sums(forest_inventory, hd_dom_method = "Weise", .progress = TRUE)
forest_inventory |
An |
hd_dom_method |
Method for calculating the dominant diameter and
dominant height. The default choice is "Weise". See the documentation of
|
.progress |
Logical, if TRUE (default) a progress bar will be shown during execution. Check the documentation of map for more options. |
A tibble containing the calculated sum and mean values
# Very small example fe_inv <- data_ex3_sample_fe_inventory[1:3, ] # Example with incomplete heights fe_inv |> pull_sums(.progress = FALSE) # Complete all heights with estimates ... suppressWarnings( # Warnings come from intentional species code casts - no problem here all_trees_with_heights <- fe_inv |> pull_trees() |> height_complete_inventory() ) # ... and run pull_sums() again fe_inv |> fill_heights_back(all_trees_with_heights, .progress = FALSE) |> pull_sums(.progress = FALSE)# Very small example fe_inv <- data_ex3_sample_fe_inventory[1:3, ] # Example with incomplete heights fe_inv |> pull_sums(.progress = FALSE) # Complete all heights with estimates ... suppressWarnings( # Warnings come from intentional species code casts - no problem here all_trees_with_heights <- fe_inv |> pull_trees() |> height_complete_inventory() ) # ... and run pull_sums() again fe_inv |> fill_heights_back(all_trees_with_heights, .progress = FALSE) |> pull_sums(.progress = FALSE)
While it has many advantages to keep inventory data in an object of class
fe_inventory, having one large data frame comprising all trees
is more convenient for many standard evaluation purposes, This function
pulls such a data frame (tibble) from an fe_inventory object.
pull_trees(forest_inventory, small_trees = FALSE, .progress = TRUE)pull_trees(forest_inventory, small_trees = FALSE, .progress = TRUE)
forest_inventory |
Object of class |
small_trees |
|
.progress |
Logical, if TRUE (default) a progress bar will be shown during execution. Check the documentation of map for more options. |
A tibble with one row per tree, holding the trees of all inventory
plots of forest_inventory in a single flat table. It is not an
object of a FeNEU class; the plot each tree belongs to is carried in the
column plot_id instead. The leading columns are plot_id,
area_rep_ha (the area in ha the plot represents), layer_key,
and species_id (an fe_species vector of whatever coding the
inventory uses); they are followed by the tree attributes of the plots'
trees slots, among them tree_id, time_yr,
age_yr, dbh_cm, height_m, removal,
ingrowth, and h_m_tree (whether the height was measured or
estimated).
Two columns are added by this function and are not tree attributes as
such. n_rep_ha is the number of trees per hectare the tree
represents; it comes from the plot but is multiplied here by the tree's
tree_count, so that a record standing for more than one tree is
correctly weighted (tree_count itself is dropped afterwards).
dbh_trshld is the lower DBH limit of the concentric circle the tree
was sampled in; it is NA for plots that are not
fe_ccircle_spatial, i.e. for stand-wise inventories.
With small_trees = TRUE the small trees of all plots are appended
as further rows, with crown_base_height_m, crown_radius_m,
and dbh_trshld set to NA.
data_ex3_sample_fe_inventory |> pull_trees()data_ex3_sample_fe_inventory |> pull_trees()
Expert-level function – standard users do not need it. The normal
import path is two calls: the matching raw_to_pre converter for your
raw format, followed by the matching pre_to_fe_inventory reader, which
alone turns the preprocessed on-disk files into a finished
fe_inventory object (see
import_sample_concentric_pre_to_fe_inventory and
import_standwise_relascope_pre_to_fe_inventory).
read_and_convert_data( input_path, inventory_type = c("sample_concentric", "standwise_relascope"), style = NULL, coord_sys = NULL, check_envelope = TRUE )read_and_convert_data( input_path, inventory_type = c("sample_concentric", "standwise_relascope"), style = NULL, coord_sys = NULL, check_envelope = TRUE )
input_path |
Path of the folder holding the preprocessed input files
(character). The required filenames depend on |
inventory_type |
Character. Which inventory chain to read. One of
|
style |
Character or |
coord_sys |
Character string specifying the coordinate reference system
of the input plot coordinates (used only by
If The geographic systems ( Note that |
check_envelope |
Logical, default |
This function is a convenience dispatcher for expert / programmatic
use – e.g. when the inventory chain has to be chosen at run time from an
argument. It routes to the matching pre_to_fe_inventory step of the two
import chains and derives the correct object_type from the inventory
type, so callers cannot mismatch them:
"sample_concentric"concentric-circle sample inventory ->
fe_ccircle_spatial plots, via
import_sample_concentric_pre_to_fe_inventory.
"standwise_relascope"stand-wise relascope
(“Winkelzählprobe” / angle-count) inventory -> fe_stand
plots, via
import_standwise_relascope_pre_to_fe_inventory.
The input must already be in the preprocessed on-disk form of the respective
chain (a folder of BaySF-style files for "sample_concentric", a
WZP_Daten.txt for "standwise_relascope"). Raw vendor formats are
brought into that form first by the matching raw_to_pre converter –
see import_sample_concentric_format1_raw_to_pre,
import_sample_concentric_format2_raw_to_pre and
import_standwise_relascope_format1_raw_to_pre.
An fe_inventory object
(fe_ccircle_spatial plots for "sample_concentric",
fe_stand plots for "standwise_relascope").
import_sample_concentric_pre_to_fe_inventory,
import_standwise_relascope_pre_to_fe_inventory
# Concentric-circle sample inventory in BaySF-style preprocessed form inv_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") read_and_convert_data(inv_path, inventory_type = "sample_concentric", coord_sys = "gk4")# Concentric-circle sample inventory in BaySF-style preprocessed form inv_path <- system.file("extdata", "data_ex3_sample_pre", package = "FeNEU") read_and_convert_data(inv_path, inventory_type = "sample_concentric", coord_sys = "gk4")
In repeated inventories with concentric sampling circles, trees that grow
across the dbh threshold of the innermost circle (typically 12 cm) between
two surveys are often mis-classified as ingrowth — even though they
physically existed during the first survey, just on the inner circle, where
they may not have been individually identifiable. This function corrects
such pseudo-ingrowth trees so that subsequent steps of the increment
calculation (tree_inc_repsurv and inv_inc_summaric)
treat them as re-measured trees with a circle transition rather than as
fresh ingrowth.
reclassify_pseudo_ingrowth_ccirc( matched_trees, inv_2nd, inv_2nd_trees, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE )reclassify_pseudo_ingrowth_ccirc( matched_trees, inv_2nd, inv_2nd_trees, tree_id_style = c("baysf", "generic"), inner_circle_non_matchable = FALSE )
matched_trees |
A data frame as produced by
|
inv_2nd |
|
inv_2nd_trees |
Extended tree data frame for the second inventory
(same object that was passed to
|
tree_id_style |
Character string indicating how trees are uniquely
identified on inventory plot level. Must be the same value that was
used when matching. Options are |
inner_circle_non_matchable |
Logical, default |
A tree is classified as pseudo-ingrowth if all of the following hold:
It is currently classified as ingrowth
(tree_exists_1st == FALSE and tree_exists_2nd == TRUE).
Its polar distance from the plot centre at the second survey
(R from tree_positions) is smaller than the radius
of the innermost circle of the plot's
circle_definition.
The innermost circle is treated as perfectly concentric. In practice it is sometimes laid out slightly off-centre (to avoid trampling small trees), but the displacement is random in direction and magnitude, so individual mis-classifications average out across many plots.
For pseudo-ingrowth trees, the first-survey volume is reconstructed via
the gnfi3 growth functions
(d_age_gnfi3,
h_age_gnfi3,
v_gri, and
v_red_harvest_ubark)
over the full inter-survey period
(dt = -(time_yr_2nd - time_yr_1st)). The estimated volume is
clamped at zero. The first-survey representation number is always set
to the inner circle's value, because the very premise of pseudo-ingrowth
identification is that the tree was sampled on the inner circle at the
first survey (Inv-2 position inside r_inner, plus unmatchable). The
gnfi3 back-estimated dbh is only used for the volume; the sampling
circle is a fact of the survey design, not a model output.
The function leaves all other trees in matched_trees untouched.
It always adds the column pseudo_ingrowth_corrected (boolean), with
TRUE for the reclassified trees and FALSE for all others.
This flag is meant to remain visible downstream so consumers can analyse
the corrected subset (e.g. for a separate tree-status category in
aggregation overviews).
Downstream consumer contract:
The per-tree methods (tree_inc_repsurv with
rep_classic, rep_mean, rep_end,
rep_trans) consume the corrected state and benefit from
the reclassification — pseudo-ingrowth trees are processed
through the standard both-exist circle-transition branches.
inv_inc_summaric explicitly undoes the
reclassification on its working copy via the
pseudo_ingrowth_corrected flag, because the
ertragsgeschichtliche balance is by definition built on
actually measured volumes and the inv_1 inner-circle cohort
was never measured. There the affected trees enter only via
the inv_2 volume sum, as they did before the reclassification.
The reclassification is only meaningful when inner-circle trees of the first inventory are inherently unmatchable:
For tree_id_style == "baysf" this is always the case
(BaySF data have no identifiers for inner-circle trees in the
first survey).
For tree_id_style == "generic" only when the survey design
marks inner-circle identifiers as unreliable. In that case the
caller must set inner_circle_non_matchable = TRUE both
here and in the upstream
match_trees_on_plot_repsurv_ccirc call so that
Inv-1 inner-circle trees are dropped from the match.
In all other situations the function simply adds the
pseudo_ingrowth_corrected column as all-FALSE and leaves
the data untouched.
The input matched_trees with two changes:
For pseudo-ingrowth trees: tree_exists_1st flipped to
TRUE; v_hub_m3_1st set to the gnfi3-back-estimated
volume (clamped at 0); n_rep_ha_1st set to the
representation number corresponding to the back-estimated dbh on
the same plot.
A new column pseudo_ingrowth_corrected (logical), with
TRUE for reclassified trees and FALSE for all
others.
Note that tree_id_1st deliberately stays NA on these rows.
The reclassification asserts that the tree existed at inv 1, not
that an individual inv-1 record was identified — there is none, which is
exactly why the tree was unmatchable. A reclassified row therefore carries
tree_exists_1st = TRUE together with tree_id_1st = NA, and
any downstream count that keys on tree_id_1st will not see it. This
is why n_in_both_1st and n_in_both_2nd of
match_tree_statistics differ by exactly the number of
pseudo-ingrowth trees.
The existing v_hub_m3_at_thrsh value is preserved as-is — it
was already correctly computed for the ingrowth case by
calc_v_hub_m3_at_thrsh, and that same threshold volume is what
the circle-transition branch of tree_inc_repsurv needs
after reclassification.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
tree_inc_repsurv()
Other repeated inventory:
harmonize_inv_for_repsurv(),
inv_increment_repsurv_ccirc(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc()
# Prepare two matching inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") mtch_trs <- match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" ) # Reclassify pseudo-ingrowth — default tree_id_style "baysf" mtch_trs_corr <- reclassify_pseudo_ingrowth_ccirc( mtch_trs, inv_b, inv_b_trees, tree_id_style = "baysf" ) sum(mtch_trs_corr$pseudo_ingrowth_corrected)# Prepare two matching inventories inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") mtch_trs <- match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" ) # Reclassify pseudo-ingrowth — default tree_id_style "baysf" mtch_trs_corr <- reclassify_pseudo_ingrowth_ccirc( mtch_trs, inv_b, inv_b_trees, tree_id_style = "baysf" ) sum(mtch_trs_corr$pseudo_ingrowth_corrected)
Computes the standard error and confidence interval for an area-weighted mean and its corresponding total, based on the ratio estimator approach. This is the standard method for forest inventory data where plots have different representation areas (e.g. due to slope correction in concentric circle designs).
se_area_weighted(plot_values, area_weights, conf_level = 0.95)se_area_weighted(plot_values, area_weights, conf_level = 0.95)
plot_values |
Numeric vector of per-hectare values, one per plot (e.g. volume in m3/ha, increment in m3/ha/yr). |
area_weights |
Numeric vector of representation areas in hectares,
same length as |
conf_level |
Confidence level for the interval, default 0.95. |
The area-weighted mean is computed as a ratio estimator:
Its variance is estimated as:
The total is ,
with .
Confidence intervals use the t-distribution with n - 1 degrees of
freedom. No finite population correction (FPC) is applied. For typical
forest inventories on systematic grids, the sampling fraction is
very small and the FPC is negligible. Omitting it is conservative, i.e. the
standard error is slightly overestimated.
A tibble (one row) with:
Number of plots used
Area-weighted mean (per hectare)
Standard error of the mean
Margin of error for the mean (t * SE)
Lower confidence bound of the mean
Upper confidence bound of the mean
Area-weighted total (mean_ha * total area)
Standard error of the total
Margin of error for the total (t * SE)
Lower confidence bound of the total
Upper confidence bound of the total
Margin of error as percentage of the mean
# Simple example with equal areas se_area_weighted(c(10, 12, 8, 11), area_weights = c(1, 1, 1, 1)) # Unequal representation areas (e.g. from slope correction) se_area_weighted( c(10, 12, 8, 11), area_weights = c(0.95, 1.00, 0.88, 1.02) )# Simple example with equal areas se_area_weighted(c(10, 12, 8, 11), area_weights = c(1, 1, 1, 1)) # Unequal representation areas (e.g. from slope correction) se_area_weighted( c(10, 12, 8, 11), area_weights = c(0.95, 1.00, 0.88, 1.02) )
Convenience wrapper around se_area_weighted that takes a
(possibly grouped) data frame with one row per plot per group, a value
column, and an area column, and returns one row per group with all the
columns of se_area_weighted.
se_area_weighted_grouped(data, value_col, area_col, conf_level = 0.95)se_area_weighted_grouped(data, value_col, area_col, conf_level = 0.95)
data |
A data frame. If grouped via |
value_col |
Character. Name of the per-plot per-hectare value
column (e.g. |
area_col |
Character. Name of the plot's representation area column, in hectares. |
conf_level |
Confidence level for the CI, default 0.95. |
Used as the shared primitive behind several aggregation pipelines in this package (back tables, big_overview, increment summaries). The data frame is expected to be pre-aggregated to one row per plot per group — the caller decides what “per plot” means (e.g. sum over trees in a species group, or a single per-plot quantity).
A tibble with one row per group, the group keys preserved, and
all output columns of se_area_weighted attached.
df <- tibble::tibble( group = rep(c("a", "b"), each = 4), value = c(10, 12, 8, 11, 20, 22, 18, 21), area = c( 1, 1, 1, 1, 1, 1, 1, 1) ) df |> dplyr::group_by(group) |> se_area_weighted_grouped("value", "area")df <- tibble::tibble( group = rep(c("a", "b"), each = 4), value = c(10, 12, 8, 11, 20, 22, 18, 21), area = c( 1, 1, 1, 1, 1, 1, 1, 1) ) df |> dplyr::group_by(group) |> se_area_weighted_grouped("value", "area")
Installs TinyTeX if no LaTeX distribution is found on the current system.
For pandoc, installation must be done manually (see
diagnose_pdf_toolchain for instructions).
setup_pdf_toolchain()setup_pdf_toolchain()
Invisibly, the result of diagnose_pdf_toolchain after
the setup attempt.
## Not run: # Deliberately not run, and deliberately not merely skipped on the check # farm either: this installs TinyTeX into the user's own filespace. That # must never happen unasked, least of all during a package check. setup_pdf_toolchain() ## End(Not run)## Not run: # Deliberately not run, and deliberately not merely skipped on the check # farm either: this installs TinyTeX into the user's own filespace. That # must never happen unasked, least of all during a package check. setup_pdf_toolchain() ## End(Not run)
Inventory tree data are grouped by species group, age class, and single tree diameter class. A data frame with group-wise aggregated inventory information is returned.
structure_table_age_class(inv_trees_plus, tree_filter = !.data$removal)structure_table_age_class(inv_trees_plus, tree_filter = !.data$removal)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
tree_filter |
Expression describing which trees to use in the function,
internally passed to |
A list of six data frames. detail holds the aggregated information
by species group, age class, and single tree diameter class. total
aggregates across single tree diameter classes, providing correct weighted
d_q_cm/h_q_m for the total column of each species row.
all_species holds the cross-species aggregation by age class and single
tree diameter class (body of the "Summe" block). all_total aggregates
all_species across single tree diameter classes, providing correct
weighted d_q_cm/h_q_m for the total column of the Summe
block. species_total aggregates across age classes and single tree
diameter classes (one level up from total), i.e. the species-wise
grand total used for the trailing "Summe" row
output_structure_table appends within each species' block.
species_dbh_total aggregates across age classes only (keeping the
single tree diameter class breakdown), providing the per-dbh_class
values shown in that same "Summe" row.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class_main_stand(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) |> structure_table_age_class()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) |> structure_table_age_class()
Inventory tree data are grouped by species group, age class, and single tree diameter class. A data frame with group-wise aggregated inventory information is returned.
structure_table_age_class_main_stand(inv_trees_plus)structure_table_age_class_main_stand(inv_trees_plus)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
A list of six data frames. detail holds the aggregated information
by species group, age class, and single tree diameter class, restricted to
the main stand, including area estimates. total aggregates across single
tree diameter classes, providing correct weighted
d_q_cm/h_q_m for the total column of each species row.
all_species holds the cross-species aggregation by age class and single
tree diameter class (body of the "Summe" block). all_total aggregates
all_species across single tree diameter classes, providing correct
weighted d_q_cm/h_q_m for the total column of the Summe
block. species_total aggregates across age classes and single tree
diameter classes (one level up from total), i.e. the species-wise
grand total used for the trailing "Summe" row
output_structure_table appends within each species' block.
species_dbh_total aggregates across age classes only (keeping the
single tree diameter class breakdown), providing the per-dbh_class
values shown in that same "Summe" row.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_d_q_class(),
structure_table_d_q_class_main_stand()
# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) |> structure_table_age_class_main_stand()# The prepared tree list ships with the package; see # ?data_ex3_trees_essentials for the chain that builds it. Three inventory # points are enough to show the shape of the result, and they keep the # example quick; the function takes a whole tree list alike. data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) |> structure_table_age_class_main_stand()
Inventory tree data are grouped by species group, mean diameter class, and single tree diameter class. A data frame with group-wise aggregated inventory information is returned.
structure_table_d_q_class( inv_trees_plus, dclass_back, tree_filter = !.data$removal )structure_table_d_q_class( inv_trees_plus, dclass_back, tree_filter = !.data$removal )
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
dclass_back |
Data frame listing quadratic mean diameter classes per
species group and layer on plot level. Typically the output of
|
tree_filter |
Expression describing which trees to use in the function,
internally passed to |
A list of six data frames. detail holds the aggregated information
by species group, mean diameter class, and single tree diameter class.
total aggregates across single tree diameter classes, providing correct
weighted d_q_cm/h_q_m for the total column of each species
row. all_species holds the cross-species aggregation by mean diameter
class and single tree diameter class (body of the "Summe" block). all_total
aggregates all_species across single tree diameter classes, providing
correct weighted d_q_cm/h_q_m for the total column of the
Summe block. species_total aggregates across mean diameter classes and
single tree diameter classes (one level up from total), i.e. the
species-wise grand total used for the trailing "Summe" row
output_structure_table appends within each species' block.
species_dbh_total aggregates across mean diameter classes only (keeping
the single tree diameter class breakdown), providing the per-dbh_class
values shown in that same "Summe" row.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class_main_stand()
# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. # Three inventory points are enough to show the shape of the result, and # they keep the example quick; the function takes a whole tree list alike. trees_with_heights <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) peg_back_d <- back_table_dclass(trees_with_heights) structure_table_d_q_class(trees_with_heights, dclass_back = peg_back_d)# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. # Three inventory points are enough to show the shape of the result, and # they keep the example quick; the function takes a whole tree list alike. trees_with_heights <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) peg_back_d <- back_table_dclass(trees_with_heights) structure_table_d_q_class(trees_with_heights, dclass_back = peg_back_d)
Inventory tree data are grouped by species group, mean diameter class, and single tree diameter class. A data frame with group-wise aggregated inventory information is returned.
structure_table_d_q_class_main_stand(inv_trees_plus, dclass_back)structure_table_d_q_class_main_stand(inv_trees_plus, dclass_back)
inv_trees_plus |
Data frame which covers trees from an inventory (each
row is a tree), typically obtained from an |
dclass_back |
Data frame listing quadratic mean diameter classes per
species group and layer on plot level. Typically the output of
|
Very similar aggregation table to the one produced by
structure_table_d_q_class, but restricted to to the main stand
(layer_key == 1) only. It contains, however, estimates of areas covered by
species (sub-)groups and ha-related values o these cohorts. Due the
methodological dubiousness of species area calculations in mixed stands, this
is only done for the main stand (comparably to how this was handled in the
3rd German National Forest Inventory).
A list of six data frames. detail holds the aggregated information
by species group, mean diameter class, and single tree diameter class,
restricted to the main stand, including area estimates. total aggregates
across single tree diameter classes, providing correct weighted
d_q_cm/h_q_m for the total column of each species row.
all_species holds the cross-species aggregation by mean diameter class
and single tree diameter class (body of the "Summe" block). all_total
aggregates all_species across single tree diameter classes, providing
correct weighted d_q_cm/h_q_m for the total column of the
Summe block. species_total aggregates across mean diameter classes and
single tree diameter classes (one level up from total), i.e. the
species-wise grand total used for the trailing "Summe" row
output_structure_table appends within each species' block.
species_dbh_total aggregates across mean diameter classes only (keeping
the single tree diameter class breakdown), providing the per-dbh_class
values shown in that same "Summe" row.
The returned list carries a tree_selection attribute recording which
tree cohort it represents: "mainstand" for the *_main_stand()
functions, "alllayers" for the general functions called with their
default tree_filter, or the raw tree_filter expression for a
custom filter. output_base_table /
output_structure_table carry this attribute through to their
own output, where the *_pdf() renderers read it for a
self-describing file name and the cohort disclaimer.
Other inventory tables:
base_table_age_class(),
base_table_age_class_main_stand(),
base_table_d_q_class(),
base_table_d_q_class_main_stand(),
output_base_table(),
output_increment_overall(),
output_structure_table(),
structure_table_age_class(),
structure_table_age_class_main_stand(),
structure_table_d_q_class()
# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. # Three inventory points are enough to show the shape of the result, and # they keep the example quick; the function takes a whole tree list alike. trees_with_heights <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) peg_back_d <- back_table_dclass(trees_with_heights) structure_table_d_q_class_main_stand(trees_with_heights, dclass_back = peg_back_d)# The prepared tree list is shipped with the package: it is this inventory # put through pull_trees() -> height_complete_inventory() -> # fill_heights_back() -> pull_trees() -> trees_add_essentials(). See # ?data_ex3_trees_essentials for that chain spelled out. # Three inventory points are enough to show the shape of the result, and # they keep the example quick; the function takes a whole tree list alike. trees_with_heights <- data_ex3_sample_trees_essentials |> dplyr::filter(plot_id %in% unique(plot_id)[1:3]) peg_back_d <- back_table_dclass(trees_with_heights) structure_table_d_q_class_main_stand(trees_with_heights, dclass_back = peg_back_d)
Provided for convenience, but typically not called directly but from within
the function inv_increment_repsurv_ccirc.
tree_inc_repsurv( matched_trees, method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), clamp_plausible_shrinkage = TRUE )tree_inc_repsurv( matched_trees, method = c("rep_classic", "rep_mean", "rep_end", "rep_trans"), clamp_plausible_shrinkage = TRUE )
matched_trees |
A data frame being the output of
|
method |
Character string, choices are |
clamp_plausible_shrinkage |
Logical. If |
Even though the volume increments are calculated on tree level here, they are
upscaled to 1 ha. This is important, because otherwise the increment
represented by trees that change their representation number per ha between
both inventories cannot be calculated correctly. Trees present in the first
survey only always get zero increment; such values can be replaced by
model-based estimates in a subsequent step. The function allows to choose
between four methods of increment calculation (parameter method):
rep_classic: The volume increment, , of trees that are
present in both inventories is calculated as
, with and being
the representation number per hectare and the volume of the tree at the
first and the second survey, respectively. The volume increment of the
ingrowth trees is , i.e. such trees contribute to the
increment with their full volume. This method is equivalent to the
classic stand level increment calculation (German "Ertragsgeschichtlicher
Zuwachs"), however, some trees (and plots) may also have negative
increments. This might look strange, but is fully valid from a
statistical angle of view.
rep_mean: The volume increment, , of trees that are
present in both inventories is calculated as
, and the volume increment of
ingrowth trees is calculated as , where
is the tree's volume when it crossed the sampling
threshold. This method is not compatible to the classic stand level
increment calculation. Guarantees when
clamp_plausible_shrinkage = TRUE.
rep_end: The volume increment, , of trees that are
present in both inventories is calculated as
, and the volume increment of
ingrowth trees is calculated as , where
is the tree's volume when it crossed the sampling
threshold. This method is not compatible to the classic stand level
increment calculation. Guarantees when
clamp_plausible_shrinkage = TRUE.
rep_trans: The volume increment, , of trees that are
present in both inventories, and did not cross a sampling threshold,
is calculated as , with .
For trees that crossed a sampling threshold, the calculation is
.
The volume increment of ingrowth trees is calculated as
, where is the tree's volume when it
crossed the sampling threshold. This method is not compatible to the
classic stand level increment calculation and always guarantees
(negative volume differences are clamped to zero regardless
of clamp_plausible_shrinkage).
The input data frame with two additional columns:
iv_hub_m3_ha_per_rep and iv_hub_m3_ha_yr_rep. They represent
the periodic and the (mean) annual tree volume increment in m³/ha under
bark and after harvest.
Other increment:
harmonize_inv_for_repsurv(),
increment_base_table(),
increment_base_table_main_stand(),
increment_ytables_base_table(),
inv_inc_big_overview(),
inv_inc_big_overview_2nd_only(),
inv_inc_big_overview_matches_only(),
inv_inc_fill_gaps_gnfi3(),
inv_inc_summaric(),
inv_inc_tree_2_plot(),
inv_inc_tree_consolidate(),
inv_inc_tree_extend(),
inv_inc_tree_extend_combined(),
inv_increment_gnfi3(),
inv_increment_repeated_survey(),
inv_increment_repsurv_ccirc(),
inv_increment_ytables(),
is_fe_increment_repsurv(),
match_2_inventories(),
match_2_inventories_by_center_coord(),
match_2_inventories_by_plot_id(),
match_plot_statistics(),
match_trees_on_inventory_repsurv_ccirc(),
match_trees_on_plot_repsurv_ccirc(),
output_increment_base_table(),
output_increment_base_table_pdf(),
output_increment_overall(),
output_increment_overall_pdf(),
output_increment_overview_gnfi3(),
output_increment_overview_gnfi3_pdf(),
output_increment_overview_ytables_pdf(),
reclassify_pseudo_ingrowth_ccirc()
# When called directly, considerable preparation is required inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Match inventory points inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Now, match both inventories on tree level mtch_trs <- match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" ) # Finally, calculate the increments tree_inc_repsurv(mtch_trs, method = "rep_classic") tree_inc_repsurv(mtch_trs, method = "rep_mean") tree_inc_repsurv(mtch_trs, method = "rep_end") tree_inc_repsurv(mtch_trs, method = "rep_trans")# When called directly, considerable preparation is required inv_a <- data_ex3_previous_sample_fe_inventory inv_b <- data_ex3_sample_fe_inventory # Match inventory points inv_pt_mtch <- match_2_inventories(inv_a, inv_b, "plot_id", "baysf") inv_a_trees <- data_ex3_previous_sample_trees_essentials inv_b_trees <- data_ex3_sample_trees_essentials # Now, match both inventories on tree level mtch_trs <- match_trees_on_inventory_repsurv_ccirc( inv_pt_mtch, inv_a, inv_b, inv_a_trees, inv_b_trees, tree_id_style = "baysf" ) # Finally, calculate the increments tree_inc_repsurv(mtch_trs, method = "rep_classic") tree_inc_repsurv(mtch_trs, method = "rep_mean") tree_inc_repsurv(mtch_trs, method = "rep_end") tree_inc_repsurv(mtch_trs, method = "rep_trans")
Function for intermediate calculations between pulling a trees data frame
from an fe_inventory object with pull_trees and
making aggregated evaluations and plots. Made for avoiding double
calculations of tree volume, basal area, and species groups.
trees_add_essentials( inv_trees, method = c("WWK", "BaySF"), dbh_interval = 5, age_interval = 20 )trees_add_essentials( inv_trees, method = c("WWK", "BaySF"), dbh_interval = 5, age_interval = 20 )
inv_trees |
Data frame which covers trees from an inventory (each row is
a tree), obtained from an |
method |
Character string indicating the method to be used for the species groups calculation. Default is "WWK", which is the method used for the species coding tum_wwk_short. Additionally "BaySF" is available, for classifying species according to the groups of the Bavarian State Forest Enterprise (bavrn_state_short). |
dbh_interval |
Integer indicating the interval breaks for the dbh
classes to be formed. The breaks are internally handed over
to |
age_interval |
Integer indicating the interval breaks for the age
classes to be formed. The breaks are internally handed over
to |
The original data frame but with the additional columns
Translation of the original species ids into
the fe_species_tum_wwk_short
coding, which is useful for aggregated evaluations,
The dbh class each tree belongs to according to
dbh_breaks as an ordered factor,
The age class each tree belongs to according to
age_breaks as an ordered factor,
Basal area of each tree in m²,
Standing wood volume of each tree over bark in m³
(calculated with v_gri),
Harvested wood volume of each tree under bark in m³
(calculated with v_red_harvest_ubark).
Tree specific standing areas, calculated with
the function standing_area_gnfi3
# Complete heights are necessary for trees_add_essentials. The h_q fallback # warning is expected here (some species x layer groups lack a measured height). trees_with_heights <- suppressWarnings( data_ex3_sample_fe_inventory |> pull_trees() |> height_complete_inventory(method = "Bavaria") |> dplyr::mutate(height_m = ifelse(!h_m_tree, h_est_m, height_m)) ) # Actual application trees_add_essentials(trees_with_heights)# Complete heights are necessary for trees_add_essentials. The h_q fallback # warning is expected here (some species x layer groups lack a measured height). trees_with_heights <- suppressWarnings( data_ex3_sample_fe_inventory |> pull_trees() |> height_complete_inventory(method = "Bavaria") |> dplyr::mutate(height_m = ifelse(!h_m_tree, h_est_m, height_m)) ) # Actual application trees_add_essentials(trees_with_heights)
Regular users will not require this function. Expert users will want to use
it in combination with the constructor new_fe_inventory.
Regular users, please construct fe_inventory objects with
fe_inventory.
validate_fe_inventory(x)validate_fe_inventory(x)
x |
an object that is expected to be a correct |
Returns x, but this function is mainly called for its side
effect which is pointing out any violations of the fe_inventory
object specifications. In case of such violations, the function will
terminate with an error.
validate_fe_inventory(data_ex4_sample_fe_inventory)validate_fe_inventory(data_ex4_sample_fe_inventory)
A yield-table selection assigning a ForestElementsR yield table to every
bavrn_state tree species code, for use with
inv_increment_ytables and its overview. It is FeNEU's completed
counterpart to ForestElementsR::ytables_bavrn_state_var_1: that FER
dataset predates the additional bavrn_state tree species codes
introduced in ForestElementsR 3.0.0 and does not cover them, so
inv_increment_ytables aborts on data containing such species
(e.g. recent Bavarian State Forest inventories). This selection covers all
current bavrn_state tree species codes and is therefore the
recommended default for the bavrn_state coding.
ytables_bavrn_state_var_1_feneuytables_bavrn_state_var_1_feneu
A tibble with one row per species, and two columns:
An fe_species_bavrn_state vector (ForestElementsR
species coding "bavrn_state") identifying the tree species.
(character) The name of the ForestElementsR yield-table
object assigned to that species (e.g.
"fe_ytable_spruce_gehrhardt_moderate_1921").
The 20 species not present in the FER selection are assigned a surrogate
yield table by genus / species-group analogy to an already-assigned congener
(e.g. the additional oaks use the oak table, the elms the ash table). Three
assignments are silvicultural judgement calls: the cedars (Atlaszeder,
Libanonzeder) use the larch table, because the Bavarian State Forest counts
them in the larch species group; the Baumhasel uses the birch table, as a
minor broadleaf (“sonstiges Laubholz”). The remaining 45 species keep
exactly the assignments of ForestElementsR::ytables_bavrn_state_var_1.
Extends ForestElementsR::ytables_bavrn_state_var_1 with
surrogate assignments for the tree species codes it does not cover.
inv_increment_ytables,
ForestElementsR::ytables_bavrn_state_var_1