bSample | R Documentation |
Advanced subsampling of a terra SpatRaster for spatial modelling
bSample(x, size, samplemethods = c("uniform"))
x |
SpatRaster layer. |
size |
Sample size. |
samplemethods |
Vector of subsampling methods. One or multiple of "uniform", "stratify", "autocorrelation". |
If samplemethods = "stratify"
, samples are distributed equally among quartiles of x.
samplemethods = "autocorrelation"
weights sampling by the inverse of local Moran's I, which is
calculated used terra::autocor()
.
Vector of cell numbers.
bb2017 <- rast(system.file('extdata', 'bb2017.tif', package='bulkshift'))
s <- bSample(x = bb2017, size = 1000, samplemethods = c("stratify"))
plot(bb2017)
plot(as.points(bb2017, na.rm = FALSE)[s], add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.