1 Getting Started

1.1 Libraries Used in this Document

There are a number of useful libraries for manipulating and analyzing tree-ring data in R. In this document we will use the following tree-ring specific and general libraries.
    • burnr
    • dendroTools
    • DendroSync
    • dplR
    • ggplot2
    • TRADER
    • treeclim
    • utils

1.2 Installing and Loading Libraries

If you do not have one or many of these libraries installed you can add them by using the install.libraries(x) function where x is the name of the package you desire to install. Start by loading all of the libraries:

library(burnr)
library(dendroTools)
library(DendroSync)
library(dplR)
library(ggplot2)
library(TRADER)
library(treeclim)
library(utils)

All of these packages are cited in the README file available in the repository found at rNADEF Workbook

2 COFECHA in dplR

Using the script below, you will be able to read in raw ring width files for COFECHA-like analysis. To run your own data, change the fname to match the data in your data <- read.rwl(fname = ... , format = "auto") script. You can also examine summary statistics of your ring width file using the rwl.stats(x) function. Alternatively you can use the RWL file included in this project.

grow.rwl <- read.tucson(fname = "Yellowstone_PSME_format.txt")
There does not appear to be a header in the rwl file
There are 32 series
1       BTK05A       1741    2016   0.001
2       BTK05B       1727    2016   0.001
3       BTK6A        1649    2016   0.001
4       BTK6B        1618    2016   0.001
5       BTK06C       1680    2016   0.001
6       BTK07A       1614    2016   0.001
7       BTK07B       1640    2016   0.001
8       BTK08A       1840    2016   0.001
9       BTK8B        1437    2016   0.001
10      BTK09B       1681    2016   0.001
11      BTK09C       1493    1679   0.001
12      BTK10C       1691    2016   0.001
13      BTK11A       1618    2016   0.001
14      BTK11B       1692    2016   0.001
15      BTK12A       1551    2016   0.001
16      BTK12B       1551    1918   0.001
17      BTK13A       1637    2016   0.001
18      BTK13B       1637    1998   0.001
19      BTK13C       1652    2016   0.001
20      BTK14A       1719    2016   0.001
21      BTK14B       1716    2016   0.001
22      BTK15A       1599    2016   0.001
23      BTK 17A      1758    2016   0.001
24      BTK 17B      1769    2016   0.001
25      BTK19B       1503    2016   0.001
26      BTK19A       1473    2016   0.001
27      BTK20A       1665    2016   0.001
28      BTK20B       1685    2016   0.001
29      BTK 33A      1765    2016   0.001
30      BTK 33B      1751    2016   0.001
31      BTK 34A      1653    2016   0.001
32      BTK 34B      1655    2016   0.001
rwl.stats(grow.rwl)

You can plot this information to view the time series and/or skeleton plot of a series. To see the time series, use the function seg.plot(x). To view the skeleton plot of an individual series, use skel.plot(x[#]) where # is the series/core you would like to view.

seg.plot(grow.rwl)

skel.plot(grow.rwl[1])

You can also examine the radii (mm) for each series, common time interval, and mean sensitivity of the rwl. While there isnโ€™t a direct function in dplR to calculate radii, you can use colSums() from base R to calculate the values. For the common interval and mean sensitivity you can use common.interval() and sens1() respectively.

colSums(grow.rwl, na.rm = TRUE, dims = 1)
 BTK05A  BTK05B   BTK6A   BTK6B  BTK06C  BTK07A  BTK07B  BTK08A   BTK8B 
125.448 130.678 236.437 288.138 160.378 147.127 141.698  35.854 226.280 
 BTK09B  BTK09C  BTK10C  BTK11A  BTK11B  BTK12A  BTK12B  BTK13A  BTK13B 
 56.100  68.566 128.930 232.076 248.110 110.557  90.246 222.705 168.850 
 BTK13C  BTK14A  BTK14B  BTK15A BTK 17A BTK 17B  BTK19B  BTK19A  BTK20A 
151.969 174.576 172.746 183.356 202.596 186.586 194.488 243.716 216.798 
 BTK20B BTK 33A BTK 33B BTK 34A BTK 34B 
221.785 250.081 281.806 225.388 221.292 
crn.common <- common.interval(grow.rwl, type=c("years"), make.plot=TRUE)

sens1(grow.rwl)
[1] 0.2660017

2.1 Crossdating

Using functions from dplR you can also obtain a COFECH-like output with the corr.rwl.seg() function. You can also examine an individual series with series.rwl.plot(). Please note that the options used in the examples below are specific to this project and might be different from your specific analysis.

corr.rwl.seg(rwl = grow.rwl, seg.length = 50, bin.floor = 100, n = NULL, prewhiten = TRUE, pcrit = 0.05, biweight = TRUE, method = c("spearman"), make.plot = TRUE, label.cex = 1, floor.plus1 = FALSE, master = NULL)