extractIndex: Extract by index

Description Usage Arguments Examples

Description

object[[i]] can be used to extract individual objects from container classes such as ExpVarRasterStack, PredictiveModelList, PredictionList and PerformanceList.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'DiscreteLulcRasterStack,ANY,ANY'
x[[i, j, ...]]

## S4 method for signature 'PerformanceList,ANY,ANY'
x[[i, j, ...]]

## S4 method for signature 'PredictionList,ANY,ANY'
x[[i, j, ...]]

## S4 method for signature 'PredictiveModelList,ANY,ANY'
x[[i, j, ...]]

## S4 method for signature 'PredictiveModelList,ANY,ANY'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'ContinuousLulcRasterStack,ANY,ANY'
x[[i, j, ...]]

Arguments

x

An object of class DiscreteLulcRasterStack, ContinuousLulcRasterStack, PredictionList, PerformanceList, PredictiveModelList

i

layer number (if 'x' inherits from a RasterStack) or list index (if 'x' stores data as a list)

j

numeric (not used)

...

additional arguments (none)

drop

logical. If TRUE the result is coerced to the lowest possible dimension

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Plum Island Ecosystems

lu <- DiscreteLulcRasterStack(x=stack(pie[1:3]),
                              categories=c(1,2,3),
                              labels=c("Forest","Built","Other"),
                              t=c(0,6,14))

summary(lu[[1]])
summary(lu[[1:2]])

## Also see lulcc2-package

simonmoulds/lulcc2 documentation built on Dec. 23, 2021, 2:24 a.m.