raster_trim: Wrapper for 'raster::trim' on 'stars' objects

Description Usage Arguments Value Examples

View source: R/raster_trim.R

Description

This is a wrapper around raster::trim, to apply the function on stars objects without needing to convert to and from a Raster* object.

Usage

1

Arguments

x

A stars object

Value

A stars object with the trimmed result

Examples

1
2
3
4
5
6
7
8
library(stars)
tif = system.file("tif/L7_ETMs.tif", package = "stars")
r = read_stars(tif)
r[[1]][1:50, , 1:6] = NA
r[[1]][, 1:100, 1:6] = NA
plot(r)
r = raster_trim(r)
plot(r)

michaeldorman/geobgu documentation built on Jan. 6, 2021, 3:57 p.m.