simRasterTrain: Simulate raster train data

View source: R/SOptim_SimulateTestData-v1.R

simRasterTrainR Documentation

Simulate raster train data

Description

Uses random data to create a simulated SpatRaster useful for testing and debugging code.

Usage

simRasterTrain(
  nr = 100,
  nc = 100,
  classes = c(0, 1, NA),
  probs = c(0.1, 0.2, 0.7)
)

Arguments

nr

Number of rows for the simulated SpatRaster (default: 100).

nc

Number of columns for the simulated SpatRaster (default: 100).

classes

A vector defining integer train classes (default for single-class: c(0,1,NA) but can be used for multi-class; NA should always be included to include background nodata).

probs

A vector defining sampling probabilities for each class to use in [base::sample()] (default: c(0.1,0.2,0.7)). Values sum up to one if not are adjusted by sample function internally.

Value

A SpatRaster object with random train data.


joaofgoncalves/SegOptim documentation built on Feb. 5, 2024, 11:10 p.m.