Learn R Programming

terra (version 1.7-55)

units: units of SpatRaster or SpatRasterDataSet

Description

Get or set the units of the layers of a SpatRaster or the datasets in a SpatRasterDataSet.

Usage

# S4 method for SpatRaster
units(x)

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

# S4 method for SpatRasterDataset units(x)

# S4 method for SpatRasterDataset units(x)<-value

Value

character

Arguments

x

SpatRaster

value

character

See Also

Examples

Run this code
s <- rast(system.file("ex/logo.tif", package="terra"))   

units(s) <- c("m/s", "kg", "ha")
units(s)
s

units(s) <- "kg"
units(s)

Run the code above in your browser using DataLab