sample_negative_points: Sample negative points

View source: R/create_training_data.R

sample_negative_pointsR Documentation

Sample negative points

Description

randomly sample points from an analysis area to create a dataset of negative points given a set of positive points

Usage

sample_negative_points(
  positive_points,
  analysis_region,
  buffer = TRUE,
  buffer_radius = 15,
  negative_proportion = 1,
  rseed = NULL
)

Arguments

positive_points

SpatVector with locations of all points with positive class

analysis_region

SpatRaster with data values everywhere that points can be sampled from. All locations that should be excluded from sampling should be NA. If NULL, all cells which contain data for all layers of the predictors_raster will be used.

buffer

Return buffer around points?

buffer_radius

minimum possible distance between a positive and negative point

negative_proportion

Proportion of negative points to be generated compared to number of positive points

rseed

Optional integer to seed the random sampling. This allows exact "random" results to be reproduced multiple times. If no number is given, a random number will be chosen as a seed.

Value

SpatVector with positive and negative points, with a field "class" indicating whether each point is positive or negative


tabrasel/WetlandTools documentation built on Dec. 20, 2024, 8:50 a.m.