units: units of SpatRaster or SpatRasterDataSet

unitsR Documentation

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 signature 'SpatRaster'
units(x)

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

## S4 method for signature 'SpatRasterDataset'
units(x)

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

Arguments

x

SpatRaster

value

character

Value

character

See Also

time, names

Examples

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

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

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

terra documentation built on Oct. 13, 2023, 5:08 p.m.