Procedural example structure to demonstrate the capabilities of the 'RasterArray
' class
Source: R/data.R
rastex.Rd
Binary versions of SpatRaster
-class objects are problematic, this function is used to instantiate a RasterArray
example.
Value
A two-dimensional RasterArray
-class object, with three rows and four columns.
Examples
# create example
example <- rastex()
# subset - single bracket
example['b']
#> class : SpatRaster
#> dimensions : 180, 360, 1 (nrow, ncol, nlyr)
#> resolution : 1, 1 (x, y)
#> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84
#> source(s) : memory
#> name : layer_2
#> min value : 2
#> max value : 64801
# subset - single bracket
example[c(4, 6)]
#> class : RasterArray
#> Element properties:
#> - class : SpatRaster
#> - dimensions : 180, 360 (nrow, ncol)
#> - resolution : 1, 1 (x, y)
#> - extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
#> - coord.ref. : WGS 84
#> Array properties:
#> - dimensions : 2 (vector)
#> - num. layers : 2
#> - missing : 0
#> - proxy:
#> d f
#> "layer_4" "layer_6"
#>
# subset - double bracket
example[["layer_2"]]
#> class : SpatRaster
#> dimensions : 180, 360, 1 (nrow, ncol, nlyr)
#> resolution : 1, 1 (x, y)
#> extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84
#> source(s) : memory
#> name : layer_2
#> min value : 2
#> max value : 64801