trim_na: Trim a raster to remove NA values on the periphery

View source: R/utils.R

trim_naR Documentation

Trim a raster to remove NA values on the periphery

Description

The trim function from the terra package only remove cols and rows full of NA. This function remove all cols and rows with NA on the periphery. Useful to get a nicely formatted raster grid after reprojection.

Usage

trim_na(rast, verbose = F)

Arguments

rast

input raster (SpatRaster)

verbose

flag (default FALSE) to switch

Value

a trimmed raster (SpatRaster)


VincentGodard/gtbox documentation built on Sept. 4, 2022, 3:46 a.m.