R/calc_diam_statistics_species.R
calc_diam_statistics_species.Rd
This function calculates the diameter distribution on the level of forest reserve, species and year
calc_diam_statistics_species(data_stems)
dataframe with columns forest_reserve, species, year and measures on diameter distribution (min, max, mean, median, Q1, Q3)
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_shoots <- load_data_shoots(path_to_fieldmapdb)
data_stems <- compose_stem_data(data_dendro, data_shoots)
calc_diam_statistics_species(data_stems)
#> # A tibble: 32 × 10
#> forest_reserve year period species dbh_min_mm dbh_max_mm dbh_mean_mm
#> <chr> <int> <int> <int> <int> <int> <dbl>
#> 1 Everzwijnbad 2002 1 16 80 130 110
#> 2 Everzwijnbad 2002 1 28 60 90 70
#> 3 Everzwijnbad 2002 1 87 350 930 598
#> 4 Everzwijnbad 2012 2 16 85 145 120
#> 5 Everzwijnbad 2012 2 28 50 115 72.5
#> 6 Everzwijnbad 2012 2 87 360 950 623.
#> 7 Harras 2008 1 6 200 200 200
#> 8 Harras 2008 1 7 65 475 204
#> 9 Harras 2008 1 16 60 565 252.
#> 10 Harras 2008 1 87 370 905 694.
#> # ℹ 22 more rows
#> # ℹ 3 more variables: dbh_median_mm <dbl>, dbh_Q1_mm <dbl>, dbh_Q3_mm <dbl>