getPredictiveModelInputData: Extract data to fit predictive models

Description Usage Arguments Value See Also Examples

View source: R/getPredictiveModelInputData.R

Description

Extract a data.frame containing variables required for fitting predictive models. Column names correspond to the names of lu and ef.

Usage

1

Arguments

lu

an LulcRasterStack object

ef

an ExpVarRasterStack object

cells

index of cells to be extracted, which may be a SpatialPoints* object or a numeric vector representing cell numbers (see raster::extract)

...

additional arguments to as.data.frame

Value

A data.frame.

See Also

as.data.frame, LulcRasterStack, ExpVarRasterStack, partition

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

## 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))

idx <- data.frame(var=paste("ef_", formatC(1:3, width=3, flag=0)),
                  yr=rep(0,3),
                  dynamic=rep(FALSE,3))

ef <- ExpVarRasterStack(x=stack(pie[4:6]), index=idx)

part <- partition(x=lu, size=0.1, spatial=TRUE, t=0)

train.data <- getPredictiveModelInputData(lu=lu,
                                          ef=ef,
                                          cells=part[["train"]],
                                          t=0)
dim(train.data)
names(train.data)


## End(Not run)

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