In Core Areas, some lying deadwood is marked as 'complete tree' by giving variable intact_fragm value 10 (intact) instead of 20 (fragment) to save time (while in general all fragments are measured separately). This function calculates the total volume (sum of bole and crown volume) for this intact deadwood and keeps the initial volume in case of fragments.

calc_intact_deadwood(data_deadwood)

Arguments

data_deadwood

dataframe on logs with variables plot_id, plottype, date_dendro, species, decaystage, intact_fragm, calc_volume_m3, period and year (output of function load_data_deadwood()), in which calc_volume_m3 should be replaced by a more precise calculation

Value

A similar dataframe (data_deadwood) in which the volume of intact deadwood is replaced by a volume calculated based on tariffs. Intermediate results vol_crown_m3 and vol_bole_m3 are added as columns (which are NA in case of deadwood fragments).

Examples

library(forrescalc)
# (add path to your own fieldmap database here)
path_to_fieldmapdb <-
  system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")
data_deadwood <- load_data_deadwood(path_to_fieldmapdb)
calc_intact_deadwood(data_deadwood)
#>      forest_reserve plot_id plottype period year date_dendro totalplotarea_ha
#> 1      Everzwijnbad     101       CP      1 2002  2002-12-01        0.1017876
#> 2      Everzwijnbad     101       CP      1 2002  2002-12-01        0.1017876
#> 3      Everzwijnbad     101       CP      1 2002  2002-12-01        0.1017876
#> 4      Everzwijnbad     101       CP      1 2002  2002-12-01        0.1017876
#> 5   Withoefse heide     204       CP      1 2000  2000-07-01        0.1257000
#> 6   Withoefse heide     204       CP      1 2000  2000-07-01        0.1257000
#> 7   Withoefse heide     204       CP      1 2000  2000-07-01        0.1257000
#> 8        Liedekerke    1005       CP      1 2006  2007-01-01        0.0706858
#> 9            Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 10           Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 11           Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 12           Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 13           Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 14           Harras   21000       CA      1 2008  2009-03-01        0.9800008
#> 15     Sevendonck A  141100       CA      1 2007  2007-10-01        0.4989261
#> 16     Sevendonck A  141100       CA      1 2007  2007-10-01        0.4989261
#> 17     Sevendonck A  141100       CA      1 2007  2007-10-01        0.4989261
#> 18     Everzwijnbad     101       CP      2 2012  2013-01-10        0.1017876
#> 19     Everzwijnbad     101       CP      2 2012  2013-01-10        0.1017876
#> 20     Everzwijnbad     101       CP      2 2012  2013-01-10        0.1017876
#> 21     Everzwijnbad     101       CP      2 2012  2013-01-10        0.1017876
#> 22     Everzwijnbad     101       CP      2 2012  2013-01-10        0.1017876
#> 23  Withoefse heide     204       CP      2 2011  2012-03-01        0.1257000
#> 24  Withoefse heide     204       CP      2 2011  2012-03-01        0.1257000
#> 25  Withoefse heide     204       CP      2 2011  2012-03-01        0.1257000
#> 26 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 27 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 28 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 29 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 30 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 31 Kersselaerspleyn    2006       CP      2 2010  2010-06-17        0.2827000
#> 32 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 33 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 34 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 35 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 36           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 37           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 38           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 39           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 40           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 41           Harras   21000       CA      2 2018  2018-09-03        0.9800008
#> 42     Sevendonck A  141100       CA      2 2016  2017-02-06        0.4989261
#> 43     Sevendonck A  141100       CA      2 2016  2017-02-06        0.4989261
#> 44     Sevendonck A  141100       CA      2 2016  2017-02-06        0.4989261
#> 45     Sevendonck A  141100       CA      2 2016  2017-02-06        0.4989261
#> 46 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 47 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 48 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 49 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 50 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 51 Kersselaerspleyn    2006       CP      3 2020  2020-12-03        0.2827000
#> 52 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#> 53 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#> 54 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#> 55 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#> 56 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 57 Kersselaerspleyn   11000       CA      2 2010  2010-06-01       10.7485378
#> 58 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#> 59 Kersselaerspleyn   11000       CA      3 2020  2020-09-11       10.7485378
#>    plotarea_ha lying_deadw_id species decaystage intact_fragm calc_volume_m3
#> 1   0.10178760          11587      87         12           20       0.010111
#> 2   0.10178760          11626      87         13           20       0.051150
#> 3   0.10178760          11629      16         13           20       0.028642
#> 4   0.10178760          21595      87         10           20       0.026293
#> 5   0.12566371           4652      26         13           20       0.031397
#> 6   0.12566371           4654      26         13           20       0.132376
#> 7   0.12566371           4656      26         13           20       0.065287
#> 8   0.07068583            256      87         13           20       0.125215
#> 9   0.98000000              1      87         13           20       0.070122
#> 10  0.98000000              2      87         13           20       0.091488
#> 11  0.98000000              3      87         13           20       0.044860
#> 12  0.98000000              4      16         13           20       0.096259
#> 13  0.98000000             37      16         14           20       2.239566
#> 14  0.98000000             38      16         13           20       0.028375
#> 15  0.50000000             48      87         13           20       0.046782
#> 16  0.50000000             50      87         12           20       0.157460
#> 17  0.50000000             51      87         13           20       0.037550
#> 18  0.10178760              1      87         13           20       0.025009
#> 19  0.10178760              2      16         12           20       0.072072
#> 20  0.10178760              3      16         12           20       0.125457
#> 21  0.10178760              4      87         11           20       0.022424
#> 22  0.10178760              5      87         13           20       0.039200
#> 23  0.12566371              1      26         14           20       0.024953
#> 24  0.12566371              2      26         13           20       0.075955
#> 25  0.12566371              3      26         13           20       0.229073
#> 26  0.28274334              1       7         14           20       0.054496
#> 27  0.28274334              2       7         14           20       0.017654
#> 28  0.28274334              3      87         13           20       0.023561
#> 29  0.28274334              4      87         13           20       0.067066
#> 30  0.28274334              5      87         13           20       0.793940
#> 31  0.28274334              6       7         15           20       0.012059
#> 32 10.74850000            496       7         14           20       2.168861
#> 33 10.74850000            497       7         14           20       5.337756
#> 34 10.74850000            498       7         14           20       6.451706
#> 35 10.74850000            699      87         13           20       2.452648
#> 36  0.98000000              1      87         10           20       0.248578
#> 37  0.98000000              2      87         10           20       0.012389
#> 38  0.98000000              3      87         10           20       0.016299
#> 39  0.98000000             18      16         10           20       0.269896
#> 40  0.98000000             26      16         14           20       0.028582
#> 41  0.98000000           1002      16         12           20       0.038932
#> 42  0.50000000              7       6         14           20       0.006062
#> 43  0.50000000              9      87         13           20       0.005201
#> 44  0.50000000             20      87         13           20       0.061579
#> 45  0.50000000             26      87         13           20       0.198267
#> 46  0.28274334              1       7         14           20       0.014511
#> 47  0.28274334              2      87         13           20       0.636307
#> 48  0.28274334              3       7         12           20       0.016680
#> 49  0.28274334              4      87         14           20       0.034024
#> 50  0.28274334              5       7         12           20       0.022437
#> 51  0.28274334              8      87         13           20       0.554639
#> 52 10.74850000            496       7         14           20       0.974255
#> 53 10.74850000            497       7         14           20       3.472722
#> 54 10.74850000            498       7         14           20       4.596163
#> 55 10.74850000            699      87         13           20       2.452139
#> 56 10.74850000            687      87         13           10       3.861142
#> 57 10.74850000            701      87         11           10       9.976843
#> 58 10.74850000            687      87         13           10       3.861142
#> 59 10.74850000            701      87         13           10       8.212920
#>    calc_length_m total_length_m min_diam_mm max_diam_mm dbh_class_5cm  r_A1
#> 1          1.287          3.283          10          10          <NA>  2.25
#> 2          5.368          5.368         100         120    10 - 15 cm  2.25
#> 3          8.226          8.255          10         110    10 - 15 cm  2.25
#> 4          4.760          4.760          10         140    10 - 15 cm  2.25
#> 5          5.312          5.312          10         145    10 - 15 cm 20.00
#> 6          9.713          9.712          10         223    20 - 25 cm 20.00
#> 7          9.593          9.593          10         156    15 - 20 cm 20.00
#> 8          5.171          5.171         150         200    20 - 25 cm  2.25
#> 9          5.368          8.754          70         250    25 - 30 cm    NA
#> 10         6.436          6.435          70         190    15 - 20 cm    NA
#> 11         3.825          3.825          80         160    15 - 20 cm    NA
#> 12         5.415          5.415         130         170    15 - 20 cm    NA
#> 13        17.631         17.632         220         560    55 - 60 cm    NA
#> 14         3.406          3.406          85         120    10 - 15 cm    NA
#> 15         5.271          5.654          90         120    10 - 15 cm    NA
#> 16         4.882         19.084          10         230    20 - 25 cm    NA
#> 17         0.948         19.089          10         230    20 - 25 cm    NA
#> 18         2.044          3.278          90         140    10 - 15 cm  2.25
#> 19         9.406         11.548          60         150    15 - 20 cm  2.25
#> 20        12.979         15.052          40         190    15 - 20 cm  2.25
#> 21         3.399          3.399          60         120    10 - 15 cm  2.25
#> 22         2.843          2.843          65         190    15 - 20 cm  2.25
#> 23         2.597          2.597          90         130    10 - 15 cm 20.00
#> 24         7.655          7.655          70         150    15 - 20 cm 20.00
#> 25         9.220          9.220         120         230    20 - 25 cm 20.00
#> 26         3.540          3.540         140         140    10 - 15 cm  3.00
#> 27         1.561          1.561         120         120    10 - 15 cm  3.00
#> 28         3.249          3.249          70         120    10 - 15 cm  3.00
#> 29         2.245          2.245         190         200    20 - 25 cm  3.00
#> 30        18.749         24.985         110         300    30 - 35 cm  3.00
#> 31         3.278         12.089          22         330    30 - 35 cm  3.00
#> 32        18.459         18.450         150         490    45 - 50 cm    NA
#> 33        15.984         15.984         560         740    70 - 75 cm    NA
#> 34        33.763         33.763         180         750    75 - 80 cm    NA
#> 35        20.599         28.867         130         520    50 - 55 cm    NA
#> 36         8.624          8.624          40         310    30 - 35 cm    NA
#> 37         4.263          4.263          10         100    10 - 15 cm    NA
#> 38         4.681          4.681          10         110    10 - 15 cm    NA
#> 39        16.184         16.184          70         210    20 - 25 cm    NA
#> 40         1.615          1.615         140         160    15 - 20 cm    NA
#> 41         7.868          7.868          30         120    10 - 15 cm    NA
#> 42         0.242          7.725          70         180    15 - 20 cm    NA
#> 43         0.340          4.882         120         140    10 - 15 cm    NA
#> 44         6.858          6.858          70         140    10 - 15 cm    NA
#> 45         9.926          9.926          90         220    20 - 25 cm    NA
#> 46         2.531          2.531          70         100    10 - 15 cm  3.00
#> 47        18.455         24.593          80         280    25 - 30 cm  3.00
#> 48         2.351          2.351          90         100    10 - 15 cm  3.00
#> 49         2.206          2.206         130         150    15 - 20 cm  3.00
#> 50         2.847          2.847          90         110    10 - 15 cm  3.00
#> 51        19.844         23.716          40         280    25 - 30 cm  3.00
#> 52         7.027          7.027         400         440    40 - 45 cm    NA
#> 53        15.984         15.984         330         700    70 - 75 cm    NA
#> 54        31.056         31.056         230         610    60 - 65 cm    NA
#> 55        20.595         28.886         130         520    50 - 55 cm    NA
#> 56        30.563         30.563         130         550    55 - 60 cm    NA
#> 57        34.048         34.048          80         820    80 - 85 cm    NA
#> 58        30.563         30.563         130         550    55 - 60 cm    NA
#> 59        34.048         34.048          80         750    75 - 80 cm    NA
#>    r_A2 r_A3 r_A4 length_core_area_m width_core_area_m core_area_ha
#> 1   4.5    9   18                 NA                NA           NA
#> 2   4.5    9   18                 NA                NA           NA
#> 3   4.5    9   18                 NA                NA           NA
#> 4   4.5    9   18                 NA                NA           NA
#> 5  20.0   20   20                 NA                NA           NA
#> 6  20.0   20   20                 NA                NA           NA
#> 7  20.0   20   20                 NA                NA           NA
#> 8   4.5   15   15                 NA                NA           NA
#> 9    NA   NA   NA                140                70       0.9800
#> 10   NA   NA   NA                140                70       0.9800
#> 11   NA   NA   NA                140                70       0.9800
#> 12   NA   NA   NA                140                70       0.9800
#> 13   NA   NA   NA                140                70       0.9800
#> 14   NA   NA   NA                140                70       0.9800
#> 15   NA   NA   NA                100                50       0.5000
#> 16   NA   NA   NA                100                50       0.5000
#> 17   NA   NA   NA                100                50       0.5000
#> 18  4.5    9   18                 NA                NA           NA
#> 19  4.5    9   18                 NA                NA           NA
#> 20  4.5    9   18                 NA                NA           NA
#> 21  4.5    9   18                 NA                NA           NA
#> 22  4.5    9   18                 NA                NA           NA
#> 23 20.0   20   20                 NA                NA           NA
#> 24 20.0   20   20                 NA                NA           NA
#> 25 20.0   20   20                 NA                NA           NA
#> 26  6.0   12   30                 NA                NA           NA
#> 27  6.0   12   30                 NA                NA           NA
#> 28  6.0   12   30                 NA                NA           NA
#> 29  6.0   12   30                 NA                NA           NA
#> 30  6.0   12   30                 NA                NA           NA
#> 31  6.0   12   30                 NA                NA           NA
#> 32   NA   NA   NA                 NA                NA      10.7485
#> 33   NA   NA   NA                 NA                NA      10.7485
#> 34   NA   NA   NA                 NA                NA      10.7485
#> 35   NA   NA   NA                 NA                NA      10.7485
#> 36   NA   NA   NA                140                70       0.9800
#> 37   NA   NA   NA                140                70       0.9800
#> 38   NA   NA   NA                140                70       0.9800
#> 39   NA   NA   NA                140                70       0.9800
#> 40   NA   NA   NA                140                70       0.9800
#> 41   NA   NA   NA                140                70       0.9800
#> 42   NA   NA   NA                100                50       0.5000
#> 43   NA   NA   NA                100                50       0.5000
#> 44   NA   NA   NA                100                50       0.5000
#> 45   NA   NA   NA                100                50       0.5000
#> 46  6.0   12   30                 NA                NA           NA
#> 47  6.0   12   30                 NA                NA           NA
#> 48  6.0   12   30                 NA                NA           NA
#> 49  6.0   12   30                 NA                NA           NA
#> 50  6.0   12   30                 NA                NA           NA
#> 51  6.0   12   30                 NA                NA           NA
#> 52   NA   NA   NA                 NA                NA      10.7485
#> 53   NA   NA   NA                 NA                NA      10.7485
#> 54   NA   NA   NA                 NA                NA      10.7485
#> 55   NA   NA   NA                 NA                NA      10.7485
#> 56   NA   NA   NA                 NA                NA      10.7485
#> 57   NA   NA   NA                 NA                NA      10.7485
#> 58   NA   NA   NA                 NA                NA      10.7485
#> 59   NA   NA   NA                 NA                NA      10.7485
#>    vol_crown_m3 vol_bole_m3
#> 1            NA          NA
#> 2            NA          NA
#> 3            NA          NA
#> 4            NA          NA
#> 5            NA          NA
#> 6            NA          NA
#> 7            NA          NA
#> 8            NA          NA
#> 9            NA          NA
#> 10           NA          NA
#> 11           NA          NA
#> 12           NA          NA
#> 13           NA          NA
#> 14           NA          NA
#> 15           NA          NA
#> 16           NA          NA
#> 17           NA          NA
#> 18           NA          NA
#> 19           NA          NA
#> 20           NA          NA
#> 21           NA          NA
#> 22           NA          NA
#> 23           NA          NA
#> 24           NA          NA
#> 25           NA          NA
#> 26           NA          NA
#> 27           NA          NA
#> 28           NA          NA
#> 29           NA          NA
#> 30           NA          NA
#> 31           NA          NA
#> 32           NA          NA
#> 33           NA          NA
#> 34           NA          NA
#> 35           NA          NA
#> 36           NA          NA
#> 37           NA          NA
#> 38           NA          NA
#> 39           NA          NA
#> 40           NA          NA
#> 41           NA          NA
#> 42           NA          NA
#> 43           NA          NA
#> 44           NA          NA
#> 45           NA          NA
#> 46           NA          NA
#> 47           NA          NA
#> 48           NA          NA
#> 49           NA          NA
#> 50           NA          NA
#> 51           NA          NA
#> 52           NA          NA
#> 53           NA          NA
#> 54           NA          NA
#> 55           NA          NA
#> 56    0.6624929    3.198649
#> 57    2.3272250    7.649618
#> 58    0.6624929    3.198649
#> 59    1.7701569    6.442763