From 84c4cecbc806237d00fdc31bcd98ac220ccb0e59 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 7 Jul 2026 18:51:17 +0000 Subject: [PATCH] Add library.R --- library.R | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 library.R diff --git a/library.R b/library.R new file mode 100644 index 0000000..a1f44bc --- /dev/null +++ b/library.R @@ -0,0 +1,37 @@ +# ---------------------- +# 1. tree level mutation + +# 1.1 diameter classes +# returns the diameter class +# default to 5 cm classes +# include second argument for e.g. 10 cm classes + +diameter.class <- function(x, multiple = 5) { + multiple * floor(x / multiple + 0.5) +} + +# 1.2 diameter increment + +# ---------------------- +# 2. summarise into plot + +# 2.1 q value + +# 2.2 Gini coefficient + +# 2.3 Shannon Diversity Index + +# 2.4 Stand Diversity Index + +# 2.5 Transition period + +# 2.6 Annual recruitment + +# 2.7 Topheight + +# ---------------------- +# 3. plot level mutation + +# 3.1 form class + +# 3.2 form height \ No newline at end of file