Title: | Create Virtual Species for Species Distribution Modelling |
---|---|
Description: | A software package help user to create virtual species for species distribution modelling. It includes several methods to help user to create virtual species distribution map. Those maps can be used for Species Distribution Modelling (SDM) study. SDM use environmental data for sites of occurrence of a species to predict all the sites where the environmental conditions are suitable for the species to persist, and may be expected to occur. |
Authors: | Xiaoquan Kong [aut, cre, cph], Renyan Duan [ths], Minyi Huang [ths] |
Maintainer: | Xiaoquan Kong <[email protected]> |
License: | AGPL-3 |
Version: | 0.3.2 |
Built: | 2025-03-04 04:03:32 UTC |
Source: | https://github.com/howl-anderson/sdmvspecies |
artificial bell response method
artificialBellResponse(env.stack, config, stack = FALSE, compose = "product", rescale = TRUE)
artificialBellResponse(env.stack, config, stack = FALSE, compose = "product", rescale = TRUE)
env.stack |
a |
config |
config is a |
stack |
stack is an option that if you want not compose them togethor (result return as a |
compose |
the method compose the suitability together. Default is product |
rescale |
if |
This method mainly implement artificial bell response method, more detail see references.
rasterLayer
or rasterStack
if stack is set to TRUE
Varela, S., Anderson, R. P., García-Valdés, R., & Fernández-González, F. (2014). Environmental filters reduce the effects of sampling bias and improve predictions of ecological niche models. Ecography.
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file file.name <- files <- c("bio1.bil", "bio12.bil", "bio7.bil", "bio5.bil") files <- paste(env.dir, file.name, sep="") # make raster stack env.stack <- stack(files) # config config <- list(c("bio1",150, 50), c("bio12", 2000, 500), c("bio7", 400, 100), c("bio5", 300, 100)) # run pick mean species.raster <- artificialBellResponse(env.stack, config) # plot map plot(species.raster) # species distribution map species.distribution.raster <- species.raster > 0.2 # plot map plot(species.distribution.raster)
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file file.name <- files <- c("bio1.bil", "bio12.bil", "bio7.bil", "bio5.bil") files <- paste(env.dir, file.name, sep="") # make raster stack env.stack <- stack(files) # config config <- list(c("bio1",150, 50), c("bio12", 2000, 500), c("bio7", 400, 100), c("bio5", 300, 100)) # run pick mean species.raster <- artificialBellResponse(env.stack, config) # plot map plot(species.raster) # species distribution map species.distribution.raster <- species.raster > 0.2 # plot map plot(species.distribution.raster)
easily used PCA analysis
autoPCA(env.stack, nfactors)
autoPCA(env.stack, nfactors)
env.stack |
a |
nfactors |
Number of factors to extract |
This method implemented an easily used PCA analysis method
rasterStack
object
output config layers as rasterStack
configStack(env.stack, config)
configStack(env.stack, config)
env.stack |
a |
config |
config is a |
This method will extract rasterLayer acorrding to config, then output rasterStack as result
rasterStack
object
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file env.files <- list.files(env.dir, pattern="*.bil$", full.names=TRUE) # see the file list env.files # put the environment file in a raster stack, # which require all the environment should have same resolution and extend env.stack <- stack(env.files) # let see the env.stack var env.stack # here let's configure the environment response function and weight config <- list(c("bio1", "1", 0, 100), c("bio11", "2", -100, NULL)) env.stack <- configStack(env.stack, config) plot(env.stack)
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file env.files <- list.files(env.dir, pattern="*.bil$", full.names=TRUE) # see the file list env.files # put the environment file in a raster stack, # which require all the environment should have same resolution and extend env.stack <- stack(env.files) # let see the env.stack var env.stack # here let's configure the environment response function and weight config <- list(c("bio1", "1", 0, 100), c("bio11", "2", -100, NULL)) env.stack <- configStack(env.stack, config) plot(env.stack)
niche synthese method
nicheSynthese(env.stack, config, stack = FALSE, random.error = FALSE)
nicheSynthese(env.stack, config, stack = FALSE, random.error = FALSE)
env.stack |
a |
config |
config is a |
stack |
stack is an option that if you want not compose them togethor (result return as a |
random.error |
add random error on cell or not. Default is FALSE |
This method mainly implement niche synthese method, for more details see references
You can write several paragraphs.
rasterLayer
or rasterStack
if stack is set to TRUE
Hirzel, A. H., Helfer, V., & Metral, F. (2001). Assessing habitat-suitability models with a virtual species. Ecological modelling, 145(2), 111-121.
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file env.files <- list.files(env.dir, pattern="*.bil$", full.names=TRUE) # see the file list env.files # put the environment file in a raster stack, # which require all the environment should have same resolution and extend env.stack <- stack(env.files) # let see the env.stack var env.stack # here let's configure the environment response function and weight config <- list( c("bio1","1",2), c("bio14", "2", 2), c("bio5", "3", 1), c("bio11", "4", 2), c("bio16", "5", 1) ) # call the niche synthsis method species.raster <- nicheSynthese(env.stack, config) # let see the result raster, # you should noticed that it's continue value map not distributin map species.raster # write the map to file, so you can use it latter in GIS software # or further analysis. # #writeRaster(species.raster, "synthese.img", "HFA", overwrite=TRUE) # to make binary distribution map, you should chosee a threshold to make map # see the map then to decide the threshold to binary plot(species.raster) # choice threshold, here we choice 4 threshold <- 14 # make binary map distribution.map <- species.raster > threshold # plot the map out plot(distribution.map)
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file env.files <- list.files(env.dir, pattern="*.bil$", full.names=TRUE) # see the file list env.files # put the environment file in a raster stack, # which require all the environment should have same resolution and extend env.stack <- stack(env.files) # let see the env.stack var env.stack # here let's configure the environment response function and weight config <- list( c("bio1","1",2), c("bio14", "2", 2), c("bio5", "3", 1), c("bio11", "4", 2), c("bio16", "5", 1) ) # call the niche synthsis method species.raster <- nicheSynthese(env.stack, config) # let see the result raster, # you should noticed that it's continue value map not distributin map species.raster # write the map to file, so you can use it latter in GIS software # or further analysis. # #writeRaster(species.raster, "synthese.img", "HFA", overwrite=TRUE) # to make binary distribution map, you should chosee a threshold to make map # see the map then to decide the threshold to binary plot(species.raster) # choice threshold, here we choice 4 threshold <- 14 # make binary map distribution.map <- species.raster > threshold # plot the map out plot(distribution.map)
pick mean method
pickMean(env.stack, subset = NULL, stack = FALSE)
pickMean(env.stack, subset = NULL, stack = FALSE)
env.stack |
a |
subset |
subset is a string |
stack |
stack is an option that if you want not compose them togethor (result return as a |
This method mainly implement pick mean method
rasterLayer
or rasterStack
if stack is set to TRUE
Jiménez-Valverde, A., & Lobo, J. M. (2007). Threshold criteria for conversion of probability of species presence to either–or presence–absence. Acta oecologica, 31(3), 361-369.
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file files <- list.files(path=env.dir, pattern="*.bil$", full.names=TRUE) # make raster stack env.stack <- stack(files) # run pick mean species.raster <- pickMean(env.stack) # plot map plot(species.raster)
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file files <- list.files(path=env.dir, pattern="*.bil$", full.names=TRUE) # make raster stack env.stack <- stack(files) # run pick mean species.raster <- pickMean(env.stack) # plot map plot(species.raster)
pick median method
pickMedian(env.stack, subset = NULL, stack = FALSE)
pickMedian(env.stack, subset = NULL, stack = FALSE)
env.stack |
a |
subset |
subset is a string |
stack |
stack is an option that if you want not compose them togethor (result return as a |
This method mainly implement pick median method
rasterLayer
or rasterStack
if stack is set to TRUE
Lobo, J. M., & Tognelli, M. F. (2011). Exploring the effects of quantity and location of pseudo-absences and sampling biases on the performance of distribution models with limited point occurrence data. Journal for Nature Conservation, 19(1), 1-7.
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file files <- list.files(path=env.dir, pattern="*.bil$", full.names=TRUE) # make raster stack env.stack <- stack(files) # run pick mean species.raster <- pickMedian(env.stack) # plot map plot(species.raster)
# load the sdmvspecies library library("sdmvspecies") library("raster") # find package's location package.dir <- system.file(package="sdmvspecies") # let see where is our sdmvspecies is installed in package.dir # find env dir under the package's location env.dir <- paste(package.dir, "/external/env/", sep="") # let see env dir env.dir # get the environment raster file files <- list.files(path=env.dir, pattern="*.bil$", full.names=TRUE) # make raster stack env.stack <- stack(files) # run pick mean species.raster <- pickMedian(env.stack) # plot map plot(species.raster)
rescale the RasterStack or RasterLayer values to min:0 max:1
rescale(raster.object)
rescale(raster.object)
raster.object |
an object of RasterStack or RasterLayer class |
an object of RasterStack or RasterLayer that rescaled.
rescale the RasterLayer values to min:0 max:1
rescaleLayer(raster.layer)
rescaleLayer(raster.layer)
raster.layer |
an object of RasterLayer class |
an object of RasterLayer that rescaled.
rescale the RasterStack values to min:0 max:1
rescaleStack(raster.stack)
rescaleStack(raster.stack)
raster.stack |
an object of RasterStack class |
an object of RasterStack that rescaled.
Species Distribution Modelling (SDM) tools for Virtual Species (vspecies)
This package contain some useful tools for create and study virtual species in SDM
SDMvspcices is a tools package for creating virtual species in Species Distribution Modelling (SDM) It contains servel algorithms (methods) that already report and used in current vritual species study or application. Also many useful tools are include to help user development new algorithms (methods) and study virtual species.
Xiaoquan Kong