Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ecospat.niche.dynIndexProjGeo

Projection of niche dynamic indices to the Geography


Description

Creates a raster in geography with each pixel containing a niche dynamic index (stability, expansion, or unfilling) extracted from 2 niches generated with ecospat.grid.clim.dyn.

Usage

ecospat.niche.dynIndexProjGeo(z1,z2,env,index)

Arguments

z1

Species 1 occurrence density grid created by ecospat.grid.clim.dyn.

z2

Species 2 occurrence density grid created by ecospat.grid.clim.dyn.

env

A RasterStack or RasterBrick of environmental variables corresponding to the background (glob in ecospat.grid.clim.dyn).

index

"stability", "unfilling" or "expansion"

Details

extracts the niche dynamic index of objects created by ecospat.niche.dyn.index for each point of the background (glob) using extract (package raster). The values are binded to the geographic coordinates of env and a raster is then recreated using rasterFromXYZ

Value

raster of class RasterLayer

Author(s)

Olivier Broennimann olivier.broennimann@unil.ch

References

Broennimann, O., M.C. Fitzpatrick, P.B. Pearman, B. Petitpierre, L. Pellissier, N.G. Yoccoz, W. Thuiller, M.J. Fortin, C. Randin, N.E. Zimmermann, C.H. Graham and A. Guisan. 2012. Measuring ecological niche overlap from occurrence and spatial environmental data. Global Ecology and Biogeography, 21:481-497.

Petitpierre, B., C. Kueffer, O. Broennimann, C. Randin, C. Daehler and A. Guisan. 2012. Climatic niche shifts are rare among terrestrial plant invaders. Science, 335:1344-1348.

See Also

Examples

library(raster)

data(ecospat.testNiche)
spp <- ecospat.testNiche
xy.sp1<-subset(spp,species=="sp1")[2:3] #Bromus_erectus
xy.sp2<-subset(spp,species=="sp3")[2:3] #Daucus_carota

load(system.file("extdata", "ecospat.testEnvRaster.Rdata", package="ecospat"))

env.sp1<-extract(env,xy.sp1)
env.sp2<-extract(env,xy.sp2)
env.bkg<-na.exclude(values(env))

#################################### PCA-ENVIRONMENT ##################################

pca.cal <- dudi.pca(env.bkg, center = TRUE, scale = TRUE, scannf = FALSE, nf = 2)

# predict the scores on the axes
scores.bkg <- pca.cal$li  #scores for background climate
scores.sp1 <- suprow(pca.cal,env.sp1)$lisup				#scores for sp1
scores.sp2 <- suprow(pca.cal,env.sp2)$lisup				#scores for sp2

# calculation of occurence density (niche z)
  
z1 <- ecospat.grid.clim.dyn(scores.bkg, scores.bkg, scores.sp1,R=100)
z2 <- ecospat.grid.clim.dyn(scores.bkg, scores.bkg, scores.sp2,R=100)

plot(z1$z.uncor)
points(scores.sp1)

plot(z2$z.uncor)
points(scores.sp2)

ecospat.niche.overlap(z1,z2 ,cor = TRUE)

#################################### stability S in space ##################################

geozS<-ecospat.niche.dynIndexProjGeo(z1,z2,env,index="stability")

plot(geozS,main="Stability")
points(xy.sp1,col="red")
points(xy.sp2,col="blue")

ecospat

Spatial Ecology Miscellaneous Methods

v3.2
GPL
Authors
Olivier Broennimann [cre, aut, ctb], Valeria Di Cola [aut, ctb], Blaise Petitpierre [ctb], Frank Breiner [ctb], Daniel Scherrer [ctb], Manuela D`Amen [ctb], Christophe Randin [ctb], Robin Engler [ctb], Wim Hordijk [ctb], Heidi Mod [ctb], Julien Pottier [ctb], Mirko Di Febbraro [ctb], Loic Pellissier [ctb], Dorothea Pio [ctb], Ruben Garcia Mateo [ctb], Anne Dubuis [ctb], Luigi Maiorano [ctb], Achilleas Psomas [ctb], Charlotte Ndiribe [ctb], Nicolas Salamin [ctb], Niklaus Zimmermann [ctb], Antoine Guisan [aut]
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.