units: units of SpatRaster or SpatRasterDataSet

Description Usage Arguments Value See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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

1
2
3
4
5
6
7
8
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 Aug. 20, 2021, 9:07 a.m.