dVoCC | R Documentation |
Function to calculate the geographically closest climate analogues and related distance-based velocity. Cell analogues are identified by comparing the baseline climatic conditions at each focal cell with those existing for all other (target) cells in the future by reference to a specified climatic threshold. The function allows for the specification of search distances and incorporates both least-cost path and Great Circle (as-the-crow-flies) distances.
dVoCC(clim, n, tdiff, method = "Single", climTol, geoTol, distfun = "GreatCircle",
trans = NA, lonlat = TRUE)
clim |
|
n |
|
tdiff |
|
method |
|
climTol |
|
geoTol |
|
distfun |
|
trans |
|
lonlat |
|
A data.frame
containing the cell id of the future analogue for each focal cell (NA = no analogue available),
together with the climatic ("climDis") and geographical ("geoDis") distances in input units,
the bearing ("ang", degrees North), and resulting climate velocity ("vel", km/yr). Mean climatic distances are returned for multivariate analogues.
Jorge Garcia Molinos
Ohlemuller et al. 2006. Towards European climate risk surfaces: the extent and distribution of analogous and non-analogous climates 1931-2100. Global Ecology and Biogeography, 15, 395-405.
Hamann et al. 2015. Velocity of climate change algorithms for guiding conservation and management. Global Change Biology, 21, 997-1004.
Garcia Molinos et al. 2017. Improving the interpretability of climate landscape metrics: An ecological risk analysis of Japan's Marine Protected Areas. Global Change Biology, 23, 4440-4452.
climPCA
, climPlot
?JapTC
# Create a data frame with the necessary variables in the required order
clim <- na.omit(data.frame(getValues(JapTC), cid = 1:ncell(JapTC)))
clim[,c("x","y")] <- xyFromCell(JapTC, clim$cid)
# Constant threshold, distance-restricted velocity based on geographical distances
avocc1 <- dVoCC(clim, n = 3, tdiff = 40, method = "Single", climTol = c(10, 0.1, 0.1),
geoTol = 160, distfun = "GreatCircle", trans = NA, lonlat = TRUE)
# Cell-specific, distance-unrestricted climate analogue velocity based on least-cost path distances
# First, create the conductance matrix (all land cells considered to have conductance of 1)
r <- raster(JapTC)
r[!is.na(JapTC[[1]])] <- 1
h8 <- gdistance::transition(r, transitionFunction=mean, directions=8)
h8 <- gdistance::geoCorrection(h8, type="c")
# Now calculate the analogue velocity using the baseline SD for each variable as analogue threshold
avocc2 <- dVoCC(clim, n = 3, tdiff = 40, method = "Variable", climTol = NA, geoTol = Inf,
distfun = "LeastCost", trans = h8, lonlat = TRUE)
# Plot results
r1 <- r2 <- raster(JapTC)
r1[avocc1$focal] <- avocc1$vel
r2[avocc2$focal] <- avocc2$vel
plot(stack(r1,r2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.