Returns a function that simulates uncorrelated random fields (white noise).

simulate_random(mean = 0, sd = 1, seed = NULL)

Arguments

mean

Mean of the random values (default: 0)

sd

Standard deviation of the random values (default: 1)

seed

Optional random seed for reproducibility

Value

A function that accepts rast_grid and n and returns a SpatRaster

Examples

rast_grid = terra::rast(ncols = 300, nrows = 100,
  xmin = 0, xmax = 300, ymin = 0, ymax = 100)
sim_fn = simulate_random()
sf1 = sim_covariates(rast_grid, n = 4, method = sim_fn)
terra::plot(sf1)