knitr::opts_chunk$set(echo = TRUE) library(pliDrought2019)
Thanks Rachel for your great notes and summaries!
In July 2019, we sampled data from r nrow(pliDat)
trees, in r nrow(pliDat)/2
paired plots, distributed over r length(unique(pliDat$Opening))
openings. Each plot contained one dead pine tree, with drought as the likely mortality agent, and one live tree. The following criteria were used to identify tree pairs:
Openings were located in the Montane Spruce dry-mild subzone.
For each tree, we collected the following measurements:
Below is R code to generate some preliminary analyses of tree measurements. If you'd like to re-run the R code below, use the following scripts to install the data and load relevant libraries. You may need to install libraries into R.
# Run the following code to install package # remotes::install_github("https://github.com/hgriesbauer/pliDrought2019") # Load libraries library(pliDrought2019) library(tidyverse)
# BOXPLOTS pliDat %>% dplyr::select(`Opening`,`Plot`,`Tree #`, `Crown Volume (%)`,`Longest Branch (cm)`, `Height (m)`,`DBH (cm)`,`B (m)`,`% live needles`) %>% pivot_longer(cols=4:9,names_to="var") %>% mutate(`Tree status`=factor(`Tree #`,labels=c("Dead","Live"))) %>% ggplot(aes(y=`value`,x=`Tree status`,fill=`Tree status`))+ geom_boxplot()+ facet_wrap(~var,scales="free_y")+ theme_bw()
Some differences from these boxplots:
Heights seems to be relatively equal between live/dead trees.
The % live needles and % crown volume differences seem intuitive.
with boxplots, we lose the paired differences. Let's look at that next.
We can look at differences between live and dead trees within each plot.
First, we'll define a function to take a measurement (e.g., longest branch in the crown) and estimate differences between each tree pair, using a paired-sample t-test.
#define treeDiff function treeDiff<-function(y) {# y is the column name of interest x<- pliDat %>% dplyr::select(`Opening`,`Plot`,`Tree #`,y) %>% pivot_wider(names_from=`Tree #`,values_from=y) %>% setNames(c("Opening","Plot","Dead","Live")) return(t.test(x$Dead,x$Live,paired = TRUE)) }
Using a paired sample t-test, we see that the average difference within each pair is r treeDiff(y="Longest Branch (cm)")$estimate
. Result is significant.
treeDiff(y="Longest Branch (cm)")
Using a paired sample t-test, we see that the average difference within each pair is r treeDiff(y="DBH (cm)")$estimate
. Result is significant.
treeDiff(y="DBH (cm)")
Using a paired sample t-test, we see that the average difference within each pair is r treeDiff(y="B (m)")$estimate
. Result is significant.
treeDiff(y="B (m)")
Using a paired sample t-test, we see that the average difference within each pair is r treeDiff(y="Height (m)")$estimate
. Tree heights did not significantly differ within each plot.
treeDiff(y="Height (m)")
We also collected a single tree core from each tree, at 1.3m off the ground. Dr. Lisa Wood at UNBC is processing the cores in fall 2019 and will provide annual measures of:
We can look into this more once we receive the data from Lisa...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.