Learn R Programming

stars (version 0.6-0)

st_downsample: downsample stars or stars_proxy object by skipping rows, columns and bands

Description

downsample stars or stars_proxy object by skipping rows, columns and bands

Usage

st_downsample(x, n, ...)

# S3 method for stars st_downsample(x, n, ...)

# S3 method for stars_proxy st_downsample(x, n, ...)

Arguments

x

object of class stars or stars_proxy

n

numeric; the number of pixels/lines/bands etc that will be skipped; see Details.

...

ignored

Details

If all n == 0, no downsampling takes place; if it is 1, every second row/column/band is skipped, if it is 2, every second+third row/column/band are skipped, etc.

Downsampling a stars_proxy object returns a stars object, is equivalent to calling st_as_stars(x, downsample = 2), and only downsamples the first two (x and y) dimensions.

Downsampled regular rasters keep their dimension offsets, have a cell size (delta) that is n[i]+1 times larger, and may result in a (slightly) different extent.