Learn R Programming

dplR (version 1.7.6)

plot.crn: Plot a Tree-Ring Chronology

Description

This function makes a default plot of a tree-ring chronology from a data.frame of the type produced by chron, chron.ars, chron.stabilized, ssf.

Usage

# S3 method for crn
plot(x, add.spline = FALSE, nyrs = NULL, ...)

Value

None. Invoked for side effect (plot).

Arguments

x

a data.frame of class{crn}.e.g., as produced by chron, chron.ars, chron.stabilized, ssf.

add.spline

a logical flag. Will add a line with a smoothing spline using caps

nyrs

a number giving the rigidity of the smoothing spline. Defaults to 1/3 times the length of the first chronology if nyrs is NULL

...

Additional arguments to pass to plot.

Author

Andy Bunn. Patched and improved by Mikko Korpela.

Details

This makes a crude plot of one or more tree-ring chronologies.

See Also

chron

Examples

Run this code
library(graphics)
data(wa082)
# Truncate the RW data to a sample depth at least 5
wa082Trunc <- wa082[rowSums(!is.na(wa082))>4,]
# Detrend with age-dependent spline
wa082RWI <- detrend(wa082Trunc,method = "AgeDep")
# make several chronologies
wa082CRN1 <- chron(wa082RWI)
wa082CRN2 <- chron.stabilized(wa082RWI,
                              winLength=51,
                              biweight = TRUE,
                              running.rbar = TRUE)
wa082CRN3 <- chron.ars(wa082RWI)
wa082CRN4 <- ssf(wa082Trunc)

# and plot
plot.crn(wa082CRN1,add.spline = TRUE,nyrs=20)
plot.crn(wa082CRN2,add.spline = TRUE,nyrs=20)
plot(wa082CRN3,add.spline = TRUE,nyrs=20)
plot(wa082CRN4,add.spline = TRUE,nyrs=20)

# a custom crn
foo <- data.frame(wa082CRN1,sfc=wa082CRN4$sfc)
foo <- foo[,c(1,3,2)]
class(foo) <- c("crn","data.frame")
plot.crn(foo,add.spline = TRUE,nyrs=20)

Run the code above in your browser using DataLab