cor.pTs: Correlation of point with field

Description Usage Arguments Value Author(s) Source Examples

View source: R/math-functions.R

Description

Calculate the correlation between a point time series of class "pTs" and a field of class "pField" or "pTs", but also supports standard objects.

Usage

1
cor.pTs(point, field, debug = FALSE, ...)

Arguments

point

a "pTs" point object.

field

a "pField" or "pTs" field.

debug

point and field are brought onto the same time basis. If debug = TRUE, this new time basis is printed as a message.

...

further arguments passed on to the base R correlation function cor, such as the use argument.

Value

the correlation(s) between point and field. The class of the result depends on the class of field, so a "pField" or "pTs" object usually.

Author(s)

Thomas Laepple, modified by Thomas Münch

Source

Function based on "mat.pField.R" in paleolibary/src/.

Examples

1
2
3
4
5
6
7
8
point <- rnorm(100)
field <- pField(rnorm(100 * 10 * 10), time = 1 : 100,
                lat = 1 : 10, lon = 1 : 10)

correlation <- cor.pTs(point, field)

pts.field <- field[, 1 : 25]
correlation <- cor.pTs(point, pts.field)

EarthSystemDiagnostics/pfields documentation built on Jan. 10, 2022, 10:37 p.m.