cor_mat_overlap: Pearson correlation matrix

View source: R/cor_mat_overlap.R

cor_mat_overlapR Documentation

Pearson correlation matrix

Description

Function that creates a Pearson correlation matrix of two rwl objects compared. If the same rwl-object is passed to the function, the correlation between all series is calculated. In addition, the number of overlapping tree-rings is part of the output. The results can be used to calculate the Students' t value

Usage

cor_mat_overlap(x, y, minoverlap)

Arguments

x

rwl object of tree-ring series

y

rwl object of tree-ring series

minoverlap

the correlation will only be calculated if the number of overlapping tree-rings is equal or larger than this value

Details

The function is an adaptation of the function cor.with.limit.R() from https://github.com/AndyBunn/dplR/blob/master/R/rwi.stats.running.R. The new function is optimized and also outputs the number of overlapping rings.

Value

a list with two matrices: one with the correlation values and one with the number of overlapping tree rings for each correlation value. The matrices have row names and column names of the compared tree-ring curves

Author(s)

Andy Bunn

Ronald Visser

Examples

rwl_object1 <- hol_rom
rwl_object2 <- hol_rom
cor_mat_overlap(rwl_object1, rwl_object2, 50)
cor_mat_overlap(rwl_object1, rwl_object1, 50)


dendroNetwork documentation built on May 29, 2024, 1:08 a.m.