total {lulcc}R Documentation

Total number of cells in a categorical Raster* object

Description

Count the number of cells belonging to each category in a Raster* object.

Usage

total(x, categories)

Arguments

x

Raster* object

categories

numeric vector containing land use categories. Only cells belonging to these categories will be counted

Value

A list containing the following components:

total

a matrix containing the total number of cells belonging to each category. Rows represent layers in the input Raster* object

categories

the categories included in the calculation

Examples


## Sibuyan Island

## load observed land use data
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))

total(x=obs)
total(x=obs[[1]])
total(x=obs[[2]])


[Package lulcc version 1.0.4 Index]