Learn R Programming

terra (version 0.4-3)

sampleRegular: Take a regular sample

Description

Take a regular sample of a SpatRaster. The returned object has the same extent, but fewer cells.

Usage

# S4 method for SpatRaster,numeric
sampleRegular(x, size, ...)

Arguments

x

SpatRaster

size

numeric. The sample size

...

additional arguments. None implemented

Value

SpatRaster

Examples

Run this code
# NOT RUN {
f <- system.file("exdata/test.tif", package="terra")
r <- rast(f)
s <- sampleRegular(r, 1000)
# }

Run the code above in your browser using DataLab