Learn R Programming

terra (version 1.9-25)

agitate: Add noise to (jitter) a SpatVector of points

Description

Add noise to (jitter) a SpatVector of points. Points are moved randomly within a specified distance.

Usage

# S4 method for SpatVector
agitate(x, maxdist)

Value

SpatVector

Arguments

x

SpatVector. All other objects are passed to jitter

maxdist

positive number. The maximum distance from the original location, in meter for lon/lat, otherwise in the units of the CRS

Examples

Run this code
## SpatVector
f <- system.file("ex/lux.shp", package="terra")
v <- as.points(vect(f)[1])
p <- agitate(v, 2500)

Run the code above in your browser using DataLab