corr.series.seg {dplR}  R Documentation 
Compute correlation between a treering series and a master chronology by segment.
corr.series.seg(rwl, series, series.yrs = as.numeric(names(series)),
seg.length = 50, bin.floor = 100, n = NULL,
prewhiten = TRUE, biweight = TRUE,
method = c("spearman", "pearson","kendall"),
pcrit = 0.05,
make.plot = TRUE, floor.plus1 = FALSE, ...)
rwl 
a 
series 
a 
series.yrs 
a 
seg.length 
an even integral value giving length of segments in years (e.g., 20, 50, 100 years). 
bin.floor 
a nonnegative integral value giving the base for locating the first segment (e.g., 1600, 1700, 1800 AD). Typically 0, 10, 50, 100, etc. 
n 

prewhiten 

biweight 

method 
Can be either 
pcrit 
a number between 0 and 1 giving the critical value for the correlation test. 
make.plot 

floor.plus1 

... 
other arguments passed to plot. 
This function calculates the correlation between a treering series and a
master chronology built from a rwl object. Correlations are done by
segment (see below) and with a moving correlation with length equal to
the seg.length
. The function is typically invoked to
produce a plot.
A list
containing matrices bins
,
moving.rho
, and vectors spearman.rho
,
p.val
, and overall
.
Matrix bins
contains the years encapsulated by each bin
(segments). Matrix moving.rho
contains the moving
correlation and pvalue for a moving average equal to
seg.length
. Vector spearman.rho
contains
the correlations by bin and p.val
contains
the pvalues. Vector overall
contains the average
correlation and pvalue.
Andy Bunn. Patched and improved by Mikko Korpela.
corr.series.seg
, skel.plot
,
series.rwl.plot
, ccf.series.rwl
library(utils)
data(co021)
dat < co021
## Create a missing ring by deleting a year of growth in a random series
flagged < dat$"641143"
flagged < c(NA, flagged[325])
names(flagged) < rownames(dat)
dat$"641143" < NULL
seg.100 < corr.series.seg(rwl = dat, series = flagged,
seg.length = 100, biweight = FALSE)
## Not run:
flagged2 < co021$"641143"
names(flagged2) < rownames(dat)
seg.100.1 < corr.series.seg(rwl=dat, seg.length=100, biweight=FALSE,
series = flagged2)
## Select series by name or column position
seg.100.2 < corr.series.seg(rwl=co021, seg.length=100, biweight=FALSE,
series = "641143")
seg.100.3 < corr.series.seg(rwl=co021, seg.length=100, biweight=FALSE,
series = which(colnames(co021) == "641143"))
identical(seg.100.1, seg.100.2) # TRUE
identical(seg.100.2, seg.100.3) # TRUE
## End(Not run)