move | R Documentation |
Identifies and moves presence records to cells with environmental values.
move(longlat, layers, buffer = 0)
longlat |
matrix. Matrix of longitude and latitude or eastness and northness (two columns in this order) of species occurrence records. |
layers |
SpatRaster. As defined in package terra, see |
buffer |
numeric. Maximum distance in map units that a record will move. If 0 all |
Often records are in coastal or other areas for which no environmental data is available. This function moves such records to the closest cells with data so that no information is lost during modelling.
A matrix with new coordinate values.
region <- terra::rast(matrix(c(rep(NA,100), rep(1,100), rep(NA,100)), ncol = 15))
presences <- cbind(runif(100, 0, 0.55), runif(100, 0, 1))
terra::plot(region)
points(presences)
presences <- move(presences, region)
terra::plot(region)
points(presences)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.