as.list: Create a list of RasterLayer objects

Description Usage Arguments Value Examples

Description

Create a list of RasterLayer objects from Raster* objects

Usage

1
2
## S4 method for signature 'Raster'
as.list(x, ...)

Arguments

x

Raster* object

...

additional Raster* objects

Value

list

Examples

1
2
3
4
5
6
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)

Example output

Loading required package: sp
[[1]]
class       : RasterLayer 
dimensions  : 3, 3, 9  (nrow, ncol, ncell)
resolution  : 120, 60  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 
data source : in memory
names       : layer 
values      : 1, 9  (min, max)


[[1]]
class       : RasterLayer 
dimensions  : 3, 3, 9  (nrow, ncol, ncell)
resolution  : 120, 60  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 
data source : in memory
names       : layer.1 
values      : 1, 9  (min, max)


[[2]]
class       : RasterLayer 
dimensions  : 3, 3, 9  (nrow, ncol, ncell)
resolution  : 120, 60  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 
data source : in memory
names       : layer.2 
values      : 2, 18  (min, max)


[[3]]
class       : RasterLayer 
dimensions  : 3, 3, 9  (nrow, ncol, ncell)
resolution  : 120, 60  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 
data source : in memory
names       : layer.3 
values      : 3, 27  (min, max)


[[4]]
class       : RasterLayer 
dimensions  : 3, 3, 9  (nrow, ncol, ncell)
resolution  : 120, 60  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 
data source : in memory
names       : layer 
values      : 1, 9  (min, max)

raster documentation built on Jan. 5, 2021, 3:01 a.m.