# \donttest{
# create continuous raster
p <- raster::raster(nrows=108, ncols=108, xmn=-50, xmx=50)
raster::values(p)<- runif(n = (108*108))
raster::crs(p) <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
# create occurrences
xy <- dismo::randomPoints(p, 4)
# create original convex hull
ch.orig <- mcp(xy, crs = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
# set threshold
thr <- 0.5
# mcpSDM
mcpSDM(p, xy, ch.orig, thr)
# }
Run the code above in your browser using DataLab