Learn R Programming

lulcc (version 1.0.4)

ObsLulcRasterStack: Create an ObsLulcRasterStack object

Description

Methods to create an ObsLulcRasterStack object, which may be created from file, an existing Raster* object or a list of Raster* objects.

Usage

ObsLulcRasterStack(x, pattern, ...)

# S4 method for missing,character ObsLulcRasterStack(x, pattern, ...)

# S4 method for character,character ObsLulcRasterStack(x, pattern, ...)

# S4 method for list,character ObsLulcRasterStack(x, pattern, ...)

# S4 method for RasterLayer,ANY ObsLulcRasterStack(x, pattern, ...)

# S4 method for RasterStack,ANY ObsLulcRasterStack(x, pattern, categories, labels, t)

Arguments

x

path (character), Raster* object or list of Raster* objects. Default behaviour is to search for files in the working directory

pattern

regular expression (character). Only filenames (if x is a path) or Raster* objects (if x is a list) matching the regular expression will be returned. See raster::raster for more information about supported filetypes

additional arguments to raster::stack

categories

numeric vector of land use categories in observed maps

labels

character vector (optional) with labels corresponding to categories

t

numeric vector containing the timestep of each observed map. The first timestep must be 0

Value

An ObsLulcRasterStack object.

Details

Observed land use maps should have the same extent and resolution. The location of non-NA cells in ObsLulcRasterStack objects defines the region for subsequent analysis.

See Also

ObsLulcRasterStack-class, raster::stack

Examples

Run this code
# NOT RUN {
## Plum Island Ecosystems
obs <- ObsLulcRasterStack(x=pie,
                   pattern="lu",
                   categories=c(1,2,3),
                   labels=c("forest","built","other"),
                   t=c(0,6,14))

## Sibuyan Island
obs <- ObsLulcRasterStack(x=sibuyan$maps,
                   pattern="lu",
                   categories=c(1,2,3,4,5),
                   labels=c("forest","coconut","grass","rice","other"),
                   t=c(0,14))

# }

Run the code above in your browser using DataLab