Add random positional noise to point geometries.
Usage
addCoordNoise(
x,
amount,
method = c("disc", "uniform", "gaussian"),
seed = NULL
)Arguments
- x
An
sfobject containing onlyPOINTgeometries.- amount
Numeric scalar controlling the noise magnitude, in the units of
x's CRS (e.g. meters for a projected CRS). Interpreted as the disc radius formethod = "disc", the half-width of the uniform range formethod = "uniform", and the standard deviation formethod = "gaussian".- method
Character string specifying the noise model:
"disc"(default; uniform over a circular area),"uniform"(independent uniform noise on X and Y), or"gaussian"(independent Gaussian noise on X and Y).- seed
Optional integer to seed the random number generator for reproducible noise. Default
NULL(no seeding).
Details
Perturbs the coordinates of an sf POINT object by a random offset
drawn from one of three spatial noise models: a uniform disc (uniform
over the area of a circle of radius amount), independent uniform
noise on each axis (uniform over a square of half-width amount),
or independent Gaussian noise on each axis with standard deviation
amount.
