Description Usage Arguments Value See Also Examples
A function for visualising the generated folds on a map, and allowing interactive exploration of the data in the folds, using the RStudio Shiny app.
1 | foldExplorer(blocks, rasterLayer, speciesData)
|
blocks |
An SpatialBlock, EnvironmentalBlock or BufferedBlock object. |
rasterLayer |
A RasterLayer, RasterBrick or RasterStack object as background map for visualisation. |
speciesData |
A SpatialPointsDataFrame, SpatialPoints or sf object containing species data. |
An interactive map showing folds and the species data, that can be used to explore folds. Note that this can also be opened in a web browser window. When you return to the R console, press “Esc” to return to the prompt.
spatialBlock
, buffering
and envBlock
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ## Not run:
# load package data
awt <- raster::brick(system.file("extdata", "awt.grd", package = "blockCV"))
# import presence-absence species data
PA <- read.csv(system.file("extdata", "PA.csv", package = "blockCV"))
# make a SpatialPointsDataFrame object from data.frame
pa_data <- sp::SpatialPointsDataFrame(PA[,c("x", "y")], PA, proj4string=raster::crs(awt))
# spatial blocking by specified range and random assignment
sb <- spatialBlock(speciesData = pa_data,
species = "Species",
rasterLayer = awt,
theRange = 66000,
k = 5,
selection = 'random',
iteration = 250,
numLimit = NULL,
biomod2Format = TRUE)
foldExplorer(sb, awt, pa_data)
# buffering with presence-absence data
bf <- buffering(speciesData= pa_data,
species= "Species", # to count the number of presences and absences
theRange= 66500,
spDataType = "PA",
progress = T)
foldExplorer(bf, awt, pa_data)
# environmental clustering
eb <- envBlock(rasterLayer = awt,
speciesData = pa_data,
species = "Species",
k = 5)
foldExplorer(eb, awt, pa_data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.