Learn R Programming

lulcc (version 1.0.4)

crossTabulate: Cross tabulate land use transitions

Description

Cross tabulate land use transitions using raster::crosstab. This step should form the basis of further research into the processes driving the most important transitions in the study region (Pontius et al., 2004).

Usage

crossTabulate(x, y, ...)

# S4 method for RasterLayer,RasterLayer crossTabulate(x, y, categories, labels = as.character(categories), ...)

# S4 method for ObsLulcRasterStack,ANY crossTabulate(x, y, times, ...)

Value

A data.frame.

Arguments

x

RasterLayer representing land use map from an earlier timestep or an ObsLulcRasterStack object containing at least two land use maps for different points in time

y

RasterLayer representing land use map from a later timestep. Not used if x is an ObsLulcRasterStack object

...

additional arguments to raster::crosstab

categories

numeric vector containing land use categories to consider. Not used if x is an ObsLulcRasterStack object

labels

character vector (optional) with labels corresponding to categories. Not used if x is an ObsLulcRasterStack object

times

numeric vector representing the time points of two land use maps from ObsLulcRasterStack

References

Pontius Jr, R.G., Shusas, E., McEachern, M. (2004). Detecting important categorical land changes while accounting for persistence. Agriculture, Ecosystems & Environment 101(2):251-268.

See Also

ObsLulcRasterStack, raster::crosstab

Examples

Run this code

## Plum Island Ecosystems 

## Load observed land use maps
obs <- ObsLulcRasterStack(x=pie,
                   pattern="lu",
                   categories=c(1,2,3),
                   labels=c("forest","built","other"),
                   t=c(0,6,14))

crossTabulate(x=obs, times=c(0,14))

## RasterLayer input
crossTabulate(x=obs[[1]],
              y=obs[[3]],
              categories=c(1,2,3),
              labels=c("forest","built","other"))

Run the code above in your browser using DataLab