Learn R Programming

raster (version 3.6-30)

as.list: Create a list of RasterLayer objects

Description

Create a list of RasterLayer objects from Raster* objects

Usage

# S4 method for Raster
as.list(x, ...)

Value

list

Arguments

x

Raster* object

...

additional Raster* objects

Examples

Run this code
r <- raster(ncol=3, nrow=3)
values(r) <- 1:ncell(r)
as.list(r)

s <- stack(r,r*2,r*3)
as.list(s, r)

Run the code above in your browser using DataLab