Learn R Programming

dplR (version 1.8.0)

series.rwl.plot: Plot Series and a Master

Description

Plots a tree-ring series with a master chronology and displays their fit, segments, and detrending options in support of the cross-dating functions.

Usage

series.rwl.plot(rwl, series, series.yrs = as.numeric(names(series)),
                seg.length = 100, bin.floor = 100, n = NULL,
                nyrs = NULL, prewhiten = TRUE, ar.order.max = NULL,
                biweight = TRUE, floor.plus1 = FALSE)

Value

A list containing the filtered vectors series and

master.

Arguments

rwl

a data.frame with series as columns and years as rows such as that produced by read.rwl.

series

a numeric or character vector. Usually a tree-ring series. If the length of the value is 1, the corresponding column of rwl is selected (by name or position) as the series and ignored when building the master chronology. Otherwise, the value must be numeric.

series.yrs

a numeric vector giving the years of series. Defaults to as.numeric(names(series)). Ignored if series is an index to a column of rwl.

seg.length

an even integral value giving length of segments in years (e.g., 20, 50, 100 years).

bin.floor

a non-negative integral value giving the base for locating the first segment (e.g., 1600, 1700, 1800 AD). Typically 0, 10, 50, 100, etc.

n

NULL or an integral value giving the filter length for the hanning filter used for removal of low frequency variation.

nyrs

NULL or a number greater than zero. If not NULL, each series is divided by a smoothing spline with this rigidity (see caps) to remove low-frequency variation, as detrend does with method = "Spline". A value of 1 or less is taken as a proportion of each series' length. Unlike the hanning filter, the spline removes no years from the ends of a series. Cannot be combined with n.

prewhiten

logical flag. If TRUE each series is whitened using ar.

ar.order.max

NULL or a positive integer giving the maximum order of the ar model used to prewhiten. Prewhitening removes as many years from the start of each series as the order of the model. If NULL, the order is chosen by AIC up to the ar default, which on long series can be 20 or more. Requires prewhiten = TRUE.

biweight

logical flag. If TRUE then a robust mean is calculated using tbrm.

floor.plus1

logical flag. If TRUE, one year is added to the base location of the first segment (e.g., 1601, 1701, 1801 AD).

Author

Andy Bunn. Patched and improved by Mikko Korpela.

Details

The function is typically invoked to produce four plots showing the effect of the detrending options n and prewhiten and the binning options seg.length and bin.floor.

Plot 1

Time series plot of the filtered series and the master

Plot 2

Scatterplot of series vs. master

Plot 3

Segments that would be used in the other cross-dating functions (e.g., corr.series.seg)

Plot 4

Text giving the detrending options and the time span of the raw and filtered series and master

The series and master are returned as well.

See help pages for corr.rwl.seg, corr.series.seg, and ccf.series.rwl for more information on these arguments.

See Also

corr.rwl.seg, corr.series.seg, ccf.series.rwl

Examples

Run this code
library(utils)
data(co021)
foo <- series.rwl.plot(rwl = co021, series = "646244", seg.length = 100,
                       n = 5)
## note effect of n on first year in the series
foo <- series.rwl.plot(rwl = co021, series = "646244", seg.length = 100,
                       n = 13, prewhiten = FALSE)
bar <- series.rwl.plot(rwl = co021, series = "646244", seg.length = 100,
                       n = 7, prewhiten = FALSE)
head(foo$series)
head(bar$series)

Run the code above in your browser using DataLab