Learn R Programming

starsExtra (version 0.2.8)

trim2: Remove empty outer rows and columns

Description

Removes complete outer rows and columns which have NA values.

Usage

trim2(x)

Value

A new stars object with empty outer rows and columns removed

Arguments

x

A two-dimensional stars object

Examples

Run this code
# Single-band example
data(dem)
dem[[1]][1,] = NA
dem1 = trim2(dem)

# Multi-band example
data(landsat)
landsat[[1]][1:100,,] = NA
landsat1 = trim2(landsat)

Run the code above in your browser using DataLab