Learn R Programming

lulcc (version 1.0.4)

subset,ExpVarRasterList-method: Subset

Description

Extract a subset of objects from container classes such as ExpVarRasterList, PredictiveModelList, PredictionList and PerformanceList.

Usage

# S4 method for ExpVarRasterList
subset(x, subset, ...)

# S4 method for PredictiveModelList subset(x, subset, ...)

# S4 method for PerformanceList subset(x, subset, ...)

# S4 method for PredictionList subset(x, subset, ...)

Arguments

x

an object of class ExpVarRasterList, PredictiveModelList, PredictionList or PerformanceList

subset

integer or character indicating the objects to be extracted

...

additional arguments (none)

Examples

Run this code
# NOT RUN {
## 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))

summary(obs)
obs <- subset(obs, subset=names(obs)[1])
summary(obs)

## load explanatory variables
ef <- ExpVarRasterList(x=sibuyan$maps, pattern="ef")

summary(ef)
ef <- subset(ef, subset=1:5)
summary(ef)

# }

Run the code above in your browser using DataLab