resTime | R Documentation |
Function to calculate VoCC-based residence time of isotherms within a polygon after Loaire et al. (2009)
resTime(pg, vel, areapg = NA)
pg |
|
vel |
|
areapg |
|
a data.frame
containing for each polygon its ID, mean velocity (km/yr),
diameter of the equivalent circle (km), and residence time (years) as the ratio D/vel.
Jorge Garcia Molinos
Loarie et al. 2009. The velocity of climate change. Nature, 462, 1052-1055.
gVoCC
# Load example Exclusive Economic Zone polygon
?EEZ
?HSST
yrSST <- sumSeries(HSST, p = "1969-01/2009-12", yr0 = "1955-01-01", l = nlayers(HSST),
fun = function(x) colMeans(x, na.rm = TRUE),
freqin = "months", freqout = "years")
tr <- tempTrend(yrSST, th = 10)
sg <- spatGrad(yrSST, th = 0.0001, projected = FALSE)
v <- gVoCC(tr,sg)
vel <- v[[1]]
# Calculating area internally
a1 <- resTime(EEZ, vel, areapg = NA)
a1
# Using the area field from the polygon data table
a2 <- resTime(EEZ, vel, areapg = as.numeric(as.numeric(levels(EEZ$Area_km2))[EEZ$Area_km2]))
a2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.