bfmSpOver: Runs bfastmonitor for a spatial subset with aggregation

Description Usage Arguments Author(s) Examples

Description

Runs bfastmonitor on a rasterBrick object for a set of locations, determined by an object of class Spatial-class.

Usage

1
2
3
4
bfmSpOver(x, y, start, formula = response ~ trend + harmon, order = 3,
  lag = NULL, slag = NULL, history = c("ROC", "BP", "all"),
  type = "OLS-MOSUM", h = 0.25, end = 10, level = 0.05, mc.cores = 1,
  ...)

Arguments

x

A rasterBrick or rasterStack, ideally with time written to the z dimension. In case time is not written to the z dimension, the dates= argument has to be supplied (see zooExtract)

y

A SpatialPoints, SpatialPointsDataFrame, SpatialPolygons, SpatialPolygonsDataFrame, SpatialLines, SpatialLinesDataFrame, or extent. bfastmonitor will be ran at these locations. In case each feature of the object covers several pixels (typically SpatialPolygons(DataFrames), SpatialLines(DataFrames) and extent), an aggregation function (fun=) has to be supplied (see extract).

start

See bfastmonitor

formula

See bfastmonitor

order

See bfastmonitor

lag

See bfastmonitor

slag

See bfastmonitor

history

See bfastmonitor

type

See bfastmonitor

h

See bfastmonitor

level

See bfastmonitor

mc.cores

Numeric NUmber of cores to use (for parallel processing)

...

Arguments to be passed to zooExtract

Author(s)

Loic Dutrieux

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
# Load data
data(tura)

# 1- SpatialPoints case
# Generate SpatialPoints
sp <- sampleRegular(x = tura, size = 20, sp=TRUE)

# Run bfmSpOver with monitoring period starting year 2005 and all other default parameters of bfastmonitor
out <- bfmSpOver(tura, y = sp, start=c(2005,1))

# Visualize the results
plot(tura, 166)

# Build color palette
colfunc <- colorRampPalette(c("yellow", "red"))
colList <- colfunc(2013 - 2005)
points(out, col= colList[out$breakpoint - 2005], pch=16, cex = abs(out$magnitude/max(out$magnitude)))
# Color corresponds to timing of break and size to magnitude

# 2 - SpatialPolygons case
data(turaSp)
# Run bfmSpOver with monitoring period starting year 2002 and mean spatial aggregation function
out2 <- bfmSpOver(tura, y = turaSp, fun = mean, start=c(2002,1))

# Visualize
plot(tura, 166)
# Build color palette
colfunc <- colorRampPalette(c("yellow", "red"))
colList <- colfunc(2013 - 2002)
plot(out2, col = colList[out2$breakpoint - 2002], add = TRUE)
# Interpretation: The redder the latter the break was detected. If transparent, no break detected in spatially aggregated polygon time-series.

dutri001/bfastSpatial documentation built on May 15, 2019, 6:05 p.m.