c.PredictiveModelList: Merge PredictiveModelList objects

Description Usage Arguments Value Examples

View source: R/c.PredictiveModelList.R

Description

Combine different PredictiveModelList objects into one

Usage

1
2
## S3 method for class 'PredictiveModelList'
c(..., recursive = FALSE)

Arguments

...

two or more PredictiveModelList objects

recursive

for consistency with generic method (ignored)

Value

a PredictiveModelList object

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
27
28
29
30
31
32
33
34
35
36
37
## Not run: 

## Plum Island Ecosystems

## load data
data(pie)

## observed maps
obs <- ObsLulcRasterStack(x=pie,
                   pattern="lu", 
                   categories=c(1,2,3), 
                   labels=c("Forest","Built","Other"), 
                   t=c(0,6,14))

## explanatory variables
ef <- ExpVarRasterList(x=pie, pattern="ef")

part <- partition(x=obs[[1]], size=0.1, spatial=TRUE)
train.data <- getPredictiveModelInputData(obs=obs, ef=ef, cells=part[["train"]], t=0)

forms <- list(Built ~ ef_001+ef_002+ef_003,
              Forest ~ 1,
              Other ~ ef_001+ef_002)

glm.models <- glmModels(formula=forms, family=binomial, data=train.data, obs=obs)
glm.models

## separate glm.models into two PredictiveModelList objects
mod1 <- glm.models[[1]]
mod2 <- glm.models[[2:3]]

## put them back together again
glm.models <- c(mod1, mod2)
glm.models


## End(Not run)

lulcc documentation built on May 1, 2019, 7:05 p.m.