This is dplR version 1.7.8.
dplR is part of openDendro https://opendendro.org.
New users can visit https://opendendro.github.io/dplR-workshop/ to get started.
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(ggplot2)library(ggpubr)
Attaching package: 'ggpubr'
The following object is masked from 'package:cowplot':
get_legend
library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object is masked from 'package:dplR':
time<-
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
library(lubridate)
Attaching package: 'lubridate'
The following object is masked from 'package:cowplot':
stamp
The following objects are masked from 'package:base':
date, intersect, setdiff, union
library(mgcv)
Loading required package: nlme
Attaching package: 'nlme'
The following object is masked from 'package:dplyr':
collapse
This is mgcv 1.9-3. For overview type 'help("mgcv-package")'.
library(patchwork)
Attaching package: 'patchwork'
The following object is masked from 'package:cowplot':
align_plots
library(readxl)library(rstatix)
Attaching package: 'rstatix'
The following object is masked from 'package:stats':
filter
library(tibble)library(tidyr)library(utils)
Define colours
# Vesi: Muhos site with shallow WTvesi1 <-"#00B5E2"vesi2 <-lighten(vesi1, 0.2)vesi3 <-lighten(vesi1, 0.5)# Valo: Sievi site with deep WTvalo1 <-"#FF8200"valo2 <-lighten(valo1, 0.2)valo3 <-lighten(valo1, 0.5)# Vadelma: Highlightingvadelma1 <-"#CC0082"vadelma2 <-lighten(vadelma1, 0.5)# Kallio: Lineskallio1 <-"#54585A"kallio2 <-lighten(kallio1, 0.3)
Warning: There were 22 warnings in `mutate()`.
The first warning was:
ℹ In argument: `across(`1`:`50`, as.numeric)`.
Caused by warning:
! NAs introduced by coercion
ℹ Run `dplyr::last_dplyr_warnings()` to see the 21 remaining warnings.
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
No summary function supplied, defaulting to `mean_se()`
p_growth_shallow + p_growth_deep
Figure 4: BAI lme-models
Create models:
# Data for shallow WTbai_data_ansas <- bai_scaled |>filter(site =="Shallow WT"& year >=2001) |>mutate(site =ifelse(site =="Shallow WT", "Shallow WT", "Deep WT"),yr_treat =factor(ifelse(treatment =="Treatment", pmax(year -2014, -1), -1)),thinned =factor(treatment =="Treatment"& year >2010),year =as.numeric(year),treatment =relevel(treatment, ref ="Control") ) |>na.omit()# Model for shallow WTbai_model_ansas <-lme(bai ~ treatment + thinned + yr_treat, random =~1|year, data = bai_data_ansas)# Data for deep WTbai_data_nevaj <- bai_scaled |>filter(site =="Deep WT"& year >=2001) |>mutate(site =ifelse(site =="Deep WT", "Deep WT", "Shallow WT"),yr_treat =factor(ifelse(treatment =="Treatment", pmax(year -2014, -1), -1)),thinned =factor(treatment =="Treatment"& year >2009),year =as.numeric(year),treatment =relevel(treatment, ref ="Control") ) |>na.omit()# Model for deep WTbai_model_nevaj <-lme(bai ~ treatment + thinned + yr_treat, random =~1|year, data = bai_data_nevaj)
Warning: There were 2 warnings in `mutate()`.
The first warning was:
ℹ In argument: `mass_g100 = as.numeric(mass_g100)`.
Caused by warning:
! NAs introduced by coercion
ℹ Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
Needle length percentual differences between plots