voccTraj | R Documentation |
Function to calculate vocc trajectories after Burrows et al (2014). Trajectories are calculated by propagating climatic isopleths using the magnitude and direction of local (cell) velocities. This is a slightly modified version of the original Burrows et al. (2014) approach in that iterations of a trajectory are based on cumulative time travelled instead of using fixed time steps.
voccTraj(lonlat, vel, ang, mn, tyr, trajID = 1:nrow(lonlat), correct = FALSE)
lonlat |
|
vel |
|
ang |
|
mn |
|
tyr |
|
trajID |
|
correct |
|
a data.frame
containing the coordinates ("x", "y") of the constituent
points and identification number ("trajIDs") for each trajectory.
Jorge Garcia Molinos, David S. Schoeman and Michael T. Burrows
Burrows et al. 2014. Geographical limits to species-range shifts are suggested by climate velocity. Nature, 507, 492-495.
gVoCC
, trajClas
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]]
ang <- v[[2]]
# calculate the annual SST mean over the period
mn <- mean(yrSST, na.rm = T)
# get the set of starting cells for the trajectories
lonlat <- na.omit(data.frame(xyFromCell(vel, 1:ncell(vel)), vel[], ang[], mn[]))[,1:2]
# Calculate trajectories
# The following throws an error due to the trajectories moving beyond the raster extent
traj <- voccTraj(lonlat, vel, ang, mn, tyr = 50)
This accounts for the extent issue
traj <- voccTraj(lonlat, vel, ang, mn, tyr = 50, correct = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.