Description Usage Arguments Value See Also Examples
Given a SpatialPolygons*
object representing observed occurrence of a reference disease group (polygons
) and a template raster (raster
), use a Gaussian moving window smoother with standard deviation sigma
to generate a smoothed raster of the expected density of observations. See gaussWindow
for details of the Gaussian smoother. The resulting bias grid can be used to select pseudo-absence points in order to account for observation bias in the occurrence dataset.
1 |
polygons |
A |
raster |
A template raster for the resulting bias grid. |
sigma |
The standard deviation, in map units, of the Gaussian smoother. |
A raster of the expected density of occurrence records.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # load a test raster
raster <- raster(system.file("external/test.grd", package="raster"))
# define some occurrence points
pts <- matrix(c(179000, 330000,
181000, 333000,
180000, 332000),
ncol = 2,
byrow = TRUE)
# build a SpatialPoints object with them
pts <- SpatialPoints(pts, raster@crs)
# buffer them to create polygons
polygons <- gBuffer(pts, width = 50, byid = TRUE)
# run biasGrid with a fairly large sigma (500 metres)
bias <- biasGrid(polygons, raster, sigma = 500)
# and plot the results
plot(bias)
plot(polygons, add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.