sample_points: Sample Points from a region

View source: R/create_training_data.R

sample_pointsR Documentation

Sample Points from a region

Description

Generates a SpatVector of points in a given area.

Usage

sample_points(count, region, buffer = TRUE, radius = 15, rseed = NULL)

Arguments

count

The number of points to sample

region

A SpatRaster with NA cells anywhere a sampled point cannot be located

buffer

Should points be returned with a buffer?

radius

The radius of each buffer (ignored if buffer = FALSE)

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.

Details

This extends terra::spatSample() to generate the correct number of sampled points when the sample raster has a lot of NAs.

Value

A SpatVector of buffers.


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