noisy: Add noise to a layer of layer raster stack by swapping values

View source: R/noisy.r

noisyR Documentation

Add noise to a layer of layer raster stack by swapping values

Description

Adds noise to a layer of a raster stack by swapping values across cells. This function swaps values between a user-defined proportion of cells. It ignores (does not swap) cells with NA.

Usage

noisy(landscape, geography)

Arguments

landscape

Raster stack object.

geography

List of lists, each sublist represents a layer in landscape. See genesis.

Value

Raster stack.

Examples

set.seed(123)
geog <- list(
	noNoise1a=list(type='linear', min=-1, max=1),
	noNoise1b=list(type='linear', min=-1, max=1, noise=0),
	noisy2=list(type='linear', min=-1, max=1, noise=0.2),
	noisy4=list(type='linear', min=-1, max=1, noise=0.4),
	noisy6=list(type='linear', min=-1, max=1, noise=0.6),
	noisy8=list(type='linear', min=-1, max=1, noise=0.8),
 noise1a=list(type='linear', min=-1, max=1, noise=1),
 noise1b=list(type='random', min=-1, max=1)
)
land <- genesis(geog, size=201)
raster::plot(land)

adamlilith/enmSdmPredImport documentation built on Dec. 31, 2022, 5:40 p.m.