R: Declare RGB channels

RGB {terra} | R Documentation

## Declare RGB channels

### Description

Get or set the layers to be used as Red, Green and Blue when plotting a SpatRaster. Currently, the sole benefit of this is that `plot` will send the object to `plotRGB`

### Usage

    ## S4 method for signature 'SpatRaster'
    RGB(x)

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

### Arguments

`x` | SpatRaster
`value` | positive integers indicating the layers that are red, green and blue. Or `NULL` to remove the RGB settings

### Examples

    s <- rast(system.file("ex/logo.tif", package="terra"))
    RGB(s) <- c(1,2,3)
    plot(s)
    RGB(s) <- NULL

[Package terra version 1.2-5 Index]