corrected.iso: produces the atmospheric corrected values of isotopes

Description Usage Arguments Value Author(s) References Examples

View source: R/corrected.iso.R

Description

set the common isotopic signal at a study site with EPS value and then apply the atmospheric correction to each intra-annual isotope value

Usage

1
corrected.iso(y, isotope.data, atm.cor)

Arguments

y

years to apply the correction to isotope values

isotope.data

standardised dataset for isotope values

atm.cor

values of atmopheric corrections to apply to the isotopic common signal

Value

mean.isotope

common isotope signal

cor.iso

corrected isotope signal

EPS

Value of the EPS statistic

Author(s)

Alex Soudant Maintainer: Alex Soudant <asoudant@hotmail.fr>

References

Wigley et al., 1983

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (y, isotope.data, atm.cor) 
{
    cor(isotope.data[, 3], isotope.data[, 4])
    cor(isotope.data[, 3], isotope.data[, 5])
    cor(isotope.data[, 4], isotope.data[, 5])
    rbar <- mean(c(1, 1, 1, cor(isotope.data[, 3], isotope.data[, 
        4]), cor(isotope.data[, 3], isotope.data[, 5]), cor(isotope.data[, 
        4], isotope.data[, 5])))
    n <- 3
    nrb <- n * rbar
    denom <- 1 + (n - 1) * rbar
    EPS <- nrb/denom
    mean.isotope <- matrix(NA, length(isotope.data[, 3]), 3)
    mean.isotope[, 1] <- isotope.data[, 1]
    mean.isotope[, 2] <- isotope.data[, 2]
    for (a in 1:length(isotope.data[, 3])) {
        mean.isotope[a, 3] <- mean(c(isotope.data[a, 3], isotope.data[a, 
            4], isotope.data[a, 5]))
    }
    cor.iso <- matrix(NA, length(mean.isotope[, 3]), 3)
    cor.iso[, 1] <- mean.isotope[, 1]
    cor.iso[, 2] <- mean.isotope[, 2]
    for (i in 1:length(y)) {
        cor.iso[, 3][cor.iso[, 2] == y[i]] <- mean.isotope[, 
            3][mean.isotope[, 2] == y[i]] + atm.cor[, 2][atm.cor[, 
            1] == y[i]]
    }
    mean.isotope <<- mean.isotope
    cor.iso <<- cor.iso
    EPS <<- EPS
  }

AlexSoudant/isoclim-demonstration documentation built on May 5, 2019, 4:53 a.m.