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)

rspatial/terra documentation built on Nov. 5, 2024, 5:13 p.m.