This function calculates additional variables and makes aggregations of individual tree measures on the levels of

  • plot and year

  • plot, tree species and year

  • diameter class, plot and year

  • diameter class, plot, tree species and year

and it makes aggregations of volume data on logs on the levels of

  • decay stage, plot and year

  • decay stage, plot, tree species and year

calculate_dendrometry(
  data_dendro,
  data_deadwood,
  data_shoots,
  height_model,
  plotinfo
)

Arguments

data_dendro

dataframe on tree measures with variables plot_id, plottype, tree_measure_id, date_dendro, dbh_mm, height_m, species, alive_dead, decaystage, period, old_id, year, subcircle, plotarea_ha,... (output of function load_data_dendrometry())

data_deadwood

dataframe on logs with variables plot_id, plottype, date_dendro, species, decaystage, calc_volume_m3, period and year (output of function load_data_deadwood())

data_shoots

dataframe on shoots as given from the function load_data_shoots()

height_model

dataframe with model containing 'exp' or 'ln', coefficients P1 and P2 to calculate height model for each combination of species, forest_reserve, period and plottype. Height models in .xlsx generated by Fieldmap can be grouped in a dataframe using function load_height_models()

plotinfo

dataframe on surveyed plots with variables plot_id, plottype, forest_reserve, survey_trees, survey_deadw, period and year_dendro (output of function load_plotinfo())

Value

List of dataframes that are mentioned in the above description

Examples

library(forrescalc)
# (add path to your own fieldmap database here)
path_to_fieldmapdb <-
  system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")

data_dendro <- load_data_dendrometry(path_to_fieldmapdb)
data_deadwood <- load_data_deadwood(path_to_fieldmapdb)
data_shoots <- load_data_shoots(path_to_fieldmapdb)
# omit argument 'example_dataset = TRUE' below to use all height models
height_model <- load_height_models(example_dataset = TRUE)
plotinfo <- load_plotinfo(path_to_fieldmapdb)
#> Joining with `by = join_by(forest_reserve, plot_id, plottype, survey_trees)`
calculate_dendrometry(
  data_dendro, data_deadwood, data_shoots, height_model, plotinfo)
#> $dendro_by_plot
#> # A tibble: 17 × 16
#>    plottype plot_id  year period number_of_tree_species number_of_trees_ha
#>    <chr>      <int> <int>  <dbl>                  <int>              <dbl>
#>  1 CA         11000  1986      0                      2              0.558
#>  2 CA         11000  2000      1                      3              0.651
#>  3 CA         11000  2010      2                      3              0.558
#>  4 CA         11000  2020      3                      3              0.558
#>  5 CA         21000  2008      1                      4             28.6  
#>  6 CA         21000  2018      2                      3             26.5  
#>  7 CA        141100  2007      1                      2              8    
#>  8 CA        141100  2016      2                      2              4    
#>  9 CP           101  2002      1                      3            364.   
#> 10 CP           101  2012      2                      2            206.   
#> 11 CP           204  2000      1                      1             23.9  
#> 12 CP           204  2011      2                      1             23.9  
#> 13 CP          1005  2006      1                      1             42.4  
#> 14 CP          1005  2016      2                      1             42.4  
#> 15 CP          2006  2000      1                      1             10.6  
#> 16 CP          2006  2010      2                      1             10.6  
#> 17 CP          2006  2020      3                      1             10.6  
#> # ℹ 10 more variables: stem_number_ha <dbl>, basal_area_alive_m2_ha <dbl>,
#> #   basal_area_dead_m2_ha <dbl>, vol_alive_m3_ha <dbl>,
#> #   vol_dead_standing_m3_ha <dbl>, vol_bole_alive_m3_ha <dbl>,
#> #   vol_bole_dead_m3_ha <dbl>, vol_log_m3_ha <dbl>, vol_deadw_m3_ha <dbl>,
#> #   stems_per_tree <dbl>
#> 
#> $dendro_by_plot_species
#> # A tibble: 39 × 16
#>    plottype plot_id  year period species number_of_trees_ha stem_number_ha
#>    <chr>      <int> <int>  <dbl>   <dbl>              <dbl>          <dbl>
#>  1 CA         11000  1986      0       7             0.279          0.279 
#>  2 CA         11000  1986      0      87             0.279          0.279 
#>  3 CA         11000  2000      1       7             0.279          0.279 
#>  4 CA         11000  2000      1      16             0.0930         0.0930
#>  5 CA         11000  2000      1      87             0.279          0.279 
#>  6 CA         11000  2010      2       7             0.279          0.279 
#>  7 CA         11000  2010      2      16             0.0930         0.0930
#>  8 CA         11000  2010      2      87             0.186          0.186 
#>  9 CA         11000  2020      3       7             0.279          0.279 
#> 10 CA         11000  2020      3      16             0.0930         0.0930
#> # ℹ 29 more rows
#> # ℹ 9 more variables: basal_area_alive_m2_ha <dbl>,
#> #   basal_area_dead_m2_ha <dbl>, vol_alive_m3_ha <dbl>,
#> #   vol_dead_standing_m3_ha <dbl>, vol_bole_alive_m3_ha <dbl>,
#> #   vol_bole_dead_m3_ha <dbl>, vol_log_m3_ha <dbl>, vol_deadw_m3_ha <dbl>,
#> #   stems_per_tree <dbl>
#> 
#> $dendro_by_diam_plot
#> # A tibble: 125 × 14
#>    plottype plot_id  year period dbh_class_5cm stem_number_alive_ha
#>    <chr>      <int> <int>  <dbl> <fct>                        <dbl>
#>  1 CA         11000  1986      0 50 - 55 cm                  0.0930
#>  2 CA         11000  1986      0 60 - 65 cm                  0.0930
#>  3 CA         11000  1986      0 65 - 70 cm                  0.0930
#>  4 CA         11000  1986      0 75 - 80 cm                  0.0930
#>  5 CA         11000  1986      0 80 - 85 cm                  0.0930
#>  6 CA         11000  1986      0 85 - 90 cm                  0.0930
#>  7 CA         11000  2000      1 30 - 35 cm                  0.0930
#>  8 CA         11000  2000      1 55 - 60 cm                  0.0930
#>  9 CA         11000  2000      1 70 - 75 cm                  0.0930
#> 10 CA         11000  2000      1 75 - 80 cm                  0.0930
#> # ℹ 115 more rows
#> # ℹ 8 more variables: stem_number_dead_ha <dbl>, basal_area_alive_m2_ha <dbl>,
#> #   basal_area_dead_m2_ha <dbl>, vol_alive_m3_ha <dbl>,
#> #   vol_dead_standing_m3_ha <dbl>, vol_bole_alive_m3_ha <dbl>,
#> #   vol_bole_dead_m3_ha <dbl>, vol_log_m3_ha <dbl>
#> 
#> $dendro_by_diam_plot_species
#> # A tibble: 158 × 15
#>    plottype plot_id  year period species dbh_class_5cm stem_number_alive_ha
#>    <chr>      <int> <int>  <dbl>   <dbl> <fct>                        <dbl>
#>  1 CA         11000  1986      0       7 65 - 70 cm                  0.0930
#>  2 CA         11000  1986      0       7 80 - 85 cm                  0.0930
#>  3 CA         11000  1986      0       7 85 - 90 cm                  0.0930
#>  4 CA         11000  1986      0      87 50 - 55 cm                  0.0930
#>  5 CA         11000  1986      0      87 60 - 65 cm                  0.0930
#>  6 CA         11000  1986      0      87 75 - 80 cm                  0.0930
#>  7 CA         11000  2000      1       7 75 - 80 cm                  0.0930
#>  8 CA         11000  2000      1       7 85 - 90 cm                  0.0930
#>  9 CA         11000  2000      1       7 95 - 100 cm                 0.0930
#> 10 CA         11000  2000      1      16 30 - 35 cm                  0.0930
#> # ℹ 148 more rows
#> # ℹ 8 more variables: stem_number_dead_ha <dbl>, basal_area_alive_m2_ha <dbl>,
#> #   basal_area_dead_m2_ha <dbl>, vol_alive_m3_ha <dbl>,
#> #   vol_dead_standing_m3_ha <dbl>, vol_bole_alive_m3_ha <dbl>,
#> #   vol_bole_dead_m3_ha <dbl>, vol_log_m3_ha <dbl>
#> 
#> $deadw_by_decay_plot
#>    plottype plot_id year period decaystage vol_dead_standing_m3_ha
#> 1        CP     101 2002      1         16               0.0000000
#> 2        CP     101 2002      1         10               0.0000000
#> 3        CP     101 2002      1         12               0.0000000
#> 4        CP     101 2002      1         13               0.0000000
#> 5        CP     204 2000      1         16               0.0000000
#> 6        CP     204 2000      1         13               0.0000000
#> 7        CP    1005 2006      1         16               0.0000000
#> 8        CP    1005 2006      1         13               0.0000000
#> 9        CP    2006 2000      1         12               3.6801507
#> 10       CP    2006 2000      1         16               0.0000000
#> 11       CA   11000 2000      1         16               0.0000000
#> 12       CA   21000 2008      1         12               7.2705860
#> 13       CA   21000 2008      1         16               0.0000000
#> 14       CA   21000 2008      1         13               0.0000000
#> 15       CA   21000 2008      1         14               0.0000000
#> 16       CA  141100 2007      1         16               0.0000000
#> 17       CA  141100 2007      1         12               0.0000000
#> 18       CA  141100 2007      1         13               0.0000000
#> 19       CP     101 2012      2         12               1.0195947
#> 20       CP     101 2012      2         13               0.5865537
#> 21       CP     101 2012      2         16               0.0000000
#> 22       CP     101 2012      2         11               0.0000000
#> 23       CP     204 2011      2         16               0.0000000
#> 24       CP     204 2011      2         13               0.0000000
#> 25       CP     204 2011      2         14               0.0000000
#> 26       CP    1005 2016      2         16               0.0000000
#> 27       CP    2006 2010      2         16               0.0000000
#> 28       CP    2006 2010      2         13               0.0000000
#> 29       CP    2006 2010      2         14               0.0000000
#> 30       CP    2006 2010      2         15               0.0000000
#> 31       CA   11000 2010      2         12               0.6169605
#> 32       CA   11000 2010      2         16               0.0000000
#> 33       CA   11000 2010      2         11               0.0000000
#> 34       CA   11000 2010      2         13               0.0000000
#> 35       CA   11000 2010      2         14               0.0000000
#> 36       CA   21000 2018      2         11               0.0805941
#> 37       CA   21000 2018      2         12               2.4328335
#> 38       CA   21000 2018      2         16               0.0000000
#> 39       CA   21000 2018      2         10               0.0000000
#> 40       CA   21000 2018      2         14               0.0000000
#> 41       CA  141100 2016      2         16               0.0000000
#> 42       CA  141100 2016      2         13               0.0000000
#> 43       CA  141100 2016      2         14               0.0000000
#> 44       CP    2006 2020      3         16               0.0000000
#> 45       CP    2006 2020      3         12               0.0000000
#> 46       CP    2006 2020      3         13               0.0000000
#> 47       CP    2006 2020      3         14               0.0000000
#> 48       CA   11000 2020      3         12               0.6849400
#> 49       CA   11000 2020      3         16               0.0000000
#> 50       CA   11000 2020      3         13               0.0000000
#> 51       CA   11000 2020      3         14               0.0000000
#> 52       CA   11000 1986      0         16               0.0000000
#>    vol_bole_dead_m3_ha vol_log_m3_ha
#> 1           0.00000000    0.00000000
#> 2           0.00000000    0.25831240
#> 3           0.00000000    0.09933430
#> 4           0.00000000    0.78390687
#> 5           0.00000000    0.00000000
#> 6           0.00000000    1.82280156
#> 7           0.00000000    0.00000000
#> 8           0.00000000    1.77142988
#> 9           3.34711960    0.00000000
#> 10          0.00000000    0.00000000
#> 11          0.00000000    0.00000000
#> 12          6.06076149    0.00000000
#> 13          0.00000000    0.00000000
#> 14          0.00000000    0.33786122
#> 15          0.00000000    2.28527143
#> 16          0.00000000    0.00000000
#> 17          0.00000000    0.31492000
#> 18          0.00000000    0.16866400
#> 19          1.01959467    1.94059980
#> 20          0.57843873    0.63081356
#> 21          0.00000000    0.00000000
#> 22          0.00000000    0.22030188
#> 23          0.00000000    0.00000000
#> 24          0.00000000    2.42733570
#> 25          0.00000000    0.19856966
#> 26          0.00000000    0.00000000
#> 27          0.00000000    0.00000000
#> 28          0.00000000    3.12851579
#> 29          0.00000000    0.25517843
#> 30          0.00000000    0.04264999
#> 31          0.54898100    0.00000000
#> 32          0.00000000    0.00000000
#> 33          0.00000000    0.92820795
#> 34          0.00000000    0.58741129
#> 35          0.00000000    1.29862986
#> 36          0.05250379    0.00000000
#> 37          2.08903223    0.03972653
#> 38          0.00000000    0.00000000
#> 39          0.00000000    0.55832857
#> 40          0.00000000    0.02916531
#> 41          0.00000000    0.00000000
#> 42          0.00000000    0.53009400
#> 43          0.00000000    0.01212400
#> 44          0.00000000    0.00000000
#> 45          0.00000000    0.13834809
#> 46          0.00000000    4.21210984
#> 47          0.00000000    0.17165745
#> 48          0.54898100    0.00000000
#> 49          0.00000000    0.00000000
#> 50          0.00000000    1.35146314
#> 51          0.00000000    0.84133972
#> 52          0.00000000    0.00000000
#> 
#> $deadw_by_decay_plot_species
#>    plottype plot_id year period species decaystage vol_dead_standing_m3_ha
#> 1        CP     101 2002      1      16         16              0.00000000
#> 2        CP     101 2002      1      28         16              0.00000000
#> 3        CP     101 2002      1      87         16              0.00000000
#> 4        CP     101 2002      1      16         13              0.00000000
#> 5        CP     101 2002      1      87         10              0.00000000
#> 6        CP     101 2002      1      87         12              0.00000000
#> 7        CP     101 2002      1      87         13              0.00000000
#> 8        CP     204 2000      1      26         16              0.00000000
#> 9        CP     204 2000      1      26         13              0.00000000
#> 10       CP    1005 2006      1      87         16              0.00000000
#> 11       CP    1005 2006      1      87         13              0.00000000
#> 12       CP    2006 2000      1       7         16              0.00000000
#> 13       CP    2006 2000      1      87         12              3.68015070
#> 14       CA   11000 2000      1       7         16              0.00000000
#> 15       CA   11000 2000      1      16         16              0.00000000
#> 16       CA   11000 2000      1      87         16              0.00000000
#> 17       CA   21000 2008      1       6         16              0.00000000
#> 18       CA   21000 2008      1       7         16              0.00000000
#> 19       CA   21000 2008      1      16         12              0.04587028
#> 20       CA   21000 2008      1      16         16              0.00000000
#> 21       CA   21000 2008      1      87         12              7.22471567
#> 22       CA   21000 2008      1      87         16              0.00000000
#> 23       CA   21000 2008      1      16         13              0.00000000
#> 24       CA   21000 2008      1      16         14              0.00000000
#> 25       CA   21000 2008      1      87         13              0.00000000
#> 26       CA  141100 2007      1      28         16              0.00000000
#> 27       CA  141100 2007      1      87         16              0.00000000
#> 28       CA  141100 2007      1      87         12              0.00000000
#> 29       CA  141100 2007      1      87         13              0.00000000
#> 30       CP     101 2012      2      16         16              0.00000000
#> 31       CP     101 2012      2      28         12              1.01959467
#> 32       CP     101 2012      2      28         13              0.58655366
#> 33       CP     101 2012      2      87         16              0.00000000
#> 34       CP     101 2012      2      16         12              0.00000000
#> 35       CP     101 2012      2      87         11              0.00000000
#> 36       CP     101 2012      2      87         13              0.00000000
#> 37       CP     204 2011      2      26         16              0.00000000
#> 38       CP     204 2011      2      26         13              0.00000000
#> 39       CP     204 2011      2      26         14              0.00000000
#> 40       CP    1005 2016      2      87         16              0.00000000
#> 41       CP    2006 2010      2       7         16              0.00000000
#> 42       CP    2006 2010      2       7         14              0.00000000
#> 43       CP    2006 2010      2       7         15              0.00000000
#> 44       CP    2006 2010      2      87         13              0.00000000
#> 45       CA   11000 2010      2       7         16              0.00000000
#> 46       CA   11000 2010      2      16         16              0.00000000
#> 47       CA   11000 2010      2      87         12              0.61696050
#> 48       CA   11000 2010      2      87         16              0.00000000
#> 49       CA   11000 2010      2       7         14              0.00000000
#> 50       CA   11000 2010      2      87         11              0.00000000
#> 51       CA   11000 2010      2      87         13              0.00000000
#> 52       CA   21000 2018      2       7         11              0.08059410
#> 53       CA   21000 2018      2       7         16              0.00000000
#> 54       CA   21000 2018      2      16         12              0.01150031
#> 55       CA   21000 2018      2      16         16              0.00000000
#> 56       CA   21000 2018      2      87         12              2.42133316
#> 57       CA   21000 2018      2      87         16              0.00000000
#> 58       CA   21000 2018      2      16         10              0.00000000
#> 59       CA   21000 2018      2      16         14              0.00000000
#> 60       CA   21000 2018      2      87         10              0.00000000
#> 61       CA  141100 2016      2      28         16              0.00000000
#> 62       CA  141100 2016      2      87         16              0.00000000
#> 63       CA  141100 2016      2       6         14              0.00000000
#> 64       CA  141100 2016      2      87         13              0.00000000
#> 65       CP    2006 2020      3       7         16              0.00000000
#> 66       CP    2006 2020      3       7         12              0.00000000
#> 67       CP    2006 2020      3       7         14              0.00000000
#> 68       CP    2006 2020      3      87         13              0.00000000
#> 69       CP    2006 2020      3      87         14              0.00000000
#> 70       CA   11000 2020      3       7         16              0.00000000
#> 71       CA   11000 2020      3      16         16              0.00000000
#> 72       CA   11000 2020      3      87         12              0.68493999
#> 73       CA   11000 2020      3      87         16              0.00000000
#> 74       CA   11000 2020      3       7         14              0.00000000
#> 75       CA   11000 2020      3      87         13              0.00000000
#> 76       CA   11000 1986      0       7         16              0.00000000
#> 77       CA   11000 1986      0      87         16              0.00000000
#>    vol_bole_dead_m3_ha vol_log_m3_ha
#> 1           0.00000000    0.00000000
#> 2           0.00000000    0.00000000
#> 3           0.00000000    0.00000000
#> 4           0.00000000    0.28138987
#> 5           0.00000000    0.25831240
#> 6           0.00000000    0.09933430
#> 7           0.00000000    0.50251700
#> 8           0.00000000    0.00000000
#> 9           0.00000000    1.82280156
#> 10          0.00000000    0.00000000
#> 11          0.00000000    1.77142988
#> 12          0.00000000    0.00000000
#> 13          3.34711960    0.00000000
#> 14          0.00000000    0.00000000
#> 15          0.00000000    0.00000000
#> 16          0.00000000    0.00000000
#> 17          0.00000000    0.00000000
#> 18          0.00000000    0.00000000
#> 19          0.04587028    0.00000000
#> 20          0.00000000    0.00000000
#> 21          6.01489120    0.00000000
#> 22          0.00000000    0.00000000
#> 23          0.00000000    0.12717755
#> 24          0.00000000    2.28527143
#> 25          0.00000000    0.21068367
#> 26          0.00000000    0.00000000
#> 27          0.00000000    0.00000000
#> 28          0.00000000    0.31492000
#> 29          0.00000000    0.16866400
#> 30          0.00000000    0.00000000
#> 31          1.01959467    0.00000000
#> 32          0.57843873    0.00000000
#> 33          0.00000000    0.00000000
#> 34          0.00000000    1.94059980
#> 35          0.00000000    0.22030188
#> 36          0.00000000    0.63081356
#> 37          0.00000000    0.00000000
#> 38          0.00000000    2.42733570
#> 39          0.00000000    0.19856966
#> 40          0.00000000    0.00000000
#> 41          0.00000000    0.00000000
#> 42          0.00000000    0.25517843
#> 43          0.00000000    0.04264999
#> 44          0.00000000    3.12851579
#> 45          0.00000000    0.00000000
#> 46          0.00000000    0.00000000
#> 47          0.54898100    0.00000000
#> 48          0.00000000    0.00000000
#> 49          0.00000000    1.29862986
#> 50          0.00000000    0.92820795
#> 51          0.00000000    0.58741129
#> 52          0.05250379    0.00000000
#> 53          0.00000000    0.00000000
#> 54          0.01150031    0.03972653
#> 55          0.00000000    0.00000000
#> 56          2.07753192    0.00000000
#> 57          0.00000000    0.00000000
#> 58          0.00000000    0.27540408
#> 59          0.00000000    0.02916531
#> 60          0.00000000    0.28292449
#> 61          0.00000000    0.00000000
#> 62          0.00000000    0.00000000
#> 63          0.00000000    0.01212400
#> 64          0.00000000    0.53009400
#> 65          0.00000000    0.00000000
#> 66          0.00000000    0.13834809
#> 67          0.00000000    0.05132216
#> 68          0.00000000    4.21210984
#> 69          0.00000000    0.12033528
#> 70          0.00000000    0.00000000
#> 71          0.00000000    0.00000000
#> 72          0.54898100    0.00000000
#> 73          0.00000000    0.00000000
#> 74          0.00000000    0.84133972
#> 75          0.00000000    1.35146314
#> 76          0.00000000    0.00000000
#> 77          0.00000000    0.00000000
#>