Learn R Programming

landmap (version 0.0.13)

buffer.dist,SpatialPointsDataFrame,SpatialPixelsDataFrame-method: Derive buffer distances for a list of points

Description

Derive buffer distances using the raster::distance function, so that these can be used as predictors for spatial prediction i.e. to account for spatial proximity to low, medium and high values.

Usage

# S4 method for SpatialPointsDataFrame,SpatialPixelsDataFrame
buffer.dist(
  observations,
  predictionDomain,
  classes,
  width,
  parallel = TRUE,
  ...
)

Arguments

observations

SpatialPointsDataFrame.

predictionDomain

SpatialPixelsDataFrame.

classes

vector of selected points as factors.

width

maximum width for buffer distance.

parallel

optional parallelization setting.

...

optional arguments to pass to raster::distance function.

Value

object of class SpatialPixelsDataFrame with distances to points

References

  • Hengl, T., Nussbaum, M., Wright, M. N., Heuvelink, G. B., and Gr<U+00E4>ler, B. (2018) Random Forest as a generic framework for predictive modeling of spatial and spatio-temporal variables. PeerJ 6:e5518. 10.7717/peerj.5518

Examples

Run this code
# NOT RUN {
library(raster)
library(rgdal)
demo(meuse, echo=FALSE)
b <- buffer.dist(meuse["zinc"], meuse.grid[1],
        classes=as.factor(1:nrow(meuse)), parallel=FALSE)
# }

Run the code above in your browser using DataLab