R: units of SpatRaster or SpatRasterDataSet

units {terra} | R 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)

[Package terra version 1.2-10 Index]