if (FALSE) {
file <- system.file("external/predictors.grd", package="usdm")
r <- brick(file) # reading a RasterBrick object including 4 rasters in the Netherlands
r
plot(r) # visualize the raster layers
files.path <- system.file("external", package="usdm") # path to location of example files
require(rgdal)
sp <- readOGR(dsn=files.path,layer="species_nl") # reading species data (shapefile)
# alternatively, to read species data you can use:
require(maptools)
sp.file <- system.file("external/species_nl.shp", package="usdm")
sp <- readShapePoints(sp.file)
splisa <- speciesLisa(x=r,y=sp,uncertainty=15000,weights=c(0.22,0.2,0.38,0.2))
splisa
plot(splisa)
bnd <- readOGR(dsn=files.path,layer="boundary") # reading the boundary map
plot(splisa,bnd)
}
Run the code above in your browser using DataLab