Explore spatial block size
This function assists selection of block size. It allows the user to visualise the blocks interactively, viewing the impact of block size on number and arrangement of blocks in the landscape (and optionally on the distribution of species data in those blocks). Slide to the slected block size, and click Apply Changes to change the block size.
rangeExplorer( rasterLayer, speciesData = NULL, species = NULL, rangeTable = NULL, minRange = NULL, maxRange = NULL )
rasterLayer |
A raster object as background map for visualisation. |
speciesData |
A simple features (sf) or SpatialPoints object containing species data (response variable). If provided, the species data will be shown on the map. |
species |
Character value indicating the name of the field in which the species data (response variable e.g. 0s and 1s) are stored. If provided, species presence and absence data will be shown in different colours. |
rangeTable |
A data.frame created by |
minRange |
A numeric value to set the minimum possible range for creating spatial blocks. It is used to limit the searching domain of spatial block size. |
maxRange |
A numeric value to set the maximum possible range for creating spatial blocks. It is used to limit the searching domain of spatial block size. |
The only required argument for this function is the rasterLayer
. The rest are optional. If the rangeTable
is provided, the minimum, maximum and initial ranges for searching the size of spatial blocks will be selected
based on the spatial autocorrelation range of covariates. It is also possible to restrict the allowable range
of block sizes by using the minRange
and maxRanege
arguments.
An interactive map with blocks (and optionally species data) superimposed. 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
; spatialAutoRange
for the rangeTable
if(interactive()){ # 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 sf object from data.frame pa_data <- sf::st_as_sf(PA, coords = c("x", "y"), crs = raster::crs(awt)) rangeExplorer(rasterLayer = awt) # the only mandatory input # add species data to add them on the map rangeExplorer(rasterLayer = awt, speciesData = pa_data, species = "Species", rangeTable = NULL, minRange = 30000, # limit the search domain maxRange = 100000) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.