50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

terra (version 1.8-42)

depth: depth of SpatRaster layers

Description

Get or set the depth of the layers of a SpatRaster. Experimental.

Usage

# S4 method for SpatRaster
depth(x)

# S4 method for SpatRaster depth(x)<-value

# S4 method for SpatRaster depthName(x)

# S4 method for SpatRaster depthName(x)<-value

# S4 method for SpatRaster depthUnit(x)

# S4 method for SpatRaster depthUnit(x)<-value

Value

numeric or SpatRaster

Arguments

x

SpatRaster

value

numeric vector (depth), or character (depthName and depthUnit)

See Also

Examples

Run this code
s <- rast(nlyr=3)

depth(s) <- c(0, pi/2, pi)
depth(s)

depthName(s) <- "angle"
depthUnit(s) <- "radians"
s

Run the code above in your browser using DataLab