Learn R Programming

dplR (version 1.6.8)

crn.plot: 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.

Usage

crn.plot(crn, add.spline = FALSE, nyrs = NULL, f = 0.5, 
         crn.line.col='grey50',spline.line.col='red',
         samp.depth.col='grey90',
         samp.depth.border.col='grey80',
         crn.lwd=1,spline.lwd=1.5,
         abline.pos=1,abline.col='black',
         abline.lty=1,abline.lwd=1,
         xlab="Time",ylab="RWI",...)

# S3 method for crn plot(x, ...)

Arguments

x, crn

a data.frame e.g., as produced by chron. The data.frame should have the years in rownames(crn), the chronologies in the columns. Optionally, the last column can contain the sample depth named "samp.depth". If the data are produced via chron the object will be of class "crn" and the generic plot method can be used

add.spline

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

nyrs

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

f

a number between 0 and 1 giving the frequency response or wavelength cutoff. Defaults to 0.5

crn.line.col

color for the x line

spline.line.col

color for the spline (if added)

samp.depth.col

color for the sample depth polygon (if present)

samp.depth.border.col

border color for the sample depth polygon (if present)

crn.lwd

line width for the x line

spline.lwd

line width for the spline (if added)

abline.pos

position for a reference abline on the y-axis. No line added if NULL

abline.col

color for the reference abline (if added)

abline.lty

line type the reference abline (if added)

abline.lwd

line width for the reference abline (if added)

xlab

default label for x axis

ylab

default label for y axis

Additional arguments to pass to plot. The scale of the secondary y axis (sample depth) can be controlled with argument ylim2.

Value

None. Invoked for side effect (plot).

Details

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

See Also

chron

Examples

Run this code
# NOT RUN {
library(graphics)
library(utils)
data(cana157)
crn.plot(cana157)
plot(cana157, main='Twisted Tree Heartrot Hill')
# with added spline
crn.plot(cana157,add.spline=TRUE, nyrs=32)
## Without sample depth
cana157.mod <- cana157
cana157.mod$samp.depth <- NULL
crn.plot(cana157.mod, add.spline = TRUE)
## A raw ring-width chronology
data(ca533)
ca533.raw.crn <- chron(ca533, prefix = "CAM", prewhiten=TRUE)
plot(ca533.raw.crn,abline.pos=NULL,ylab='mm')  

# }
# NOT RUN {
  # not pretty - but illustrates the coloring options
  my.cols <- c("#3182BD","#9ECAE1","#DEEBF7","#31A354","#A1D99B","#E5F5E0")
  crn.plot(cana157,add.spline=TRUE,nyrs=32,
             crn.line.col=my.cols[5],
             spline.line.col=my.cols[4],
             samp.depth.col=my.cols[3],
             samp.depth.border.col=my.cols[2],
             abline.col=my.cols[1],
             crn.lwd=1.5,spline.lwd=3,
             abline.lwd=1,
             xlab="Year", ylab="RWI")
# }

Run the code above in your browser using DataLab