bfast_interactive: Compute BFAST interactively

Description Usage Arguments Value Examples

View source: R/bfast_interactive.R

Description

This function allows the selection of a cell by clicking on a raster plot, and then executes bfast::bfast() for the cell's time series. The function then runs and plots bfast() on the time series.

Usage

1
2
3
bfast_interactive(data_layers, obs_per_year, display = 1, add_layers = NULL,
  cell_number = NULL, new_window = TRUE, impute,
  nodata_threshold = c(0.05, 4), return_bfast = FALSE, ...)

Arguments

data_layers

A RasterBrick or RasterStack object. A RasterBrick is preferable to reduce processing time.

obs_per_year

A number indicating the number of observations in the time series per year. For example, this argument should be set to 12 for monthly data. For MODIS 16-day aggregates, this should be set to 23 (365/16, rounded to nearest integer.)

display

A number or a RasterLayer object. If display is a number, the corresponding layer from data_layers will be plotted for the cell selection. If display is a RasterLayer object, it will be plotted for cell selection.

add_layers

An optional list of Spatial objects to be plotted on top of display.

cell_number

A number indicating the cell number through which bfast() should be run from data_layers. Ignored if display is supplied.

new_window

A logical indicating if the BFAST results should appear in a new graphics window.

impute

A logical indicating whether the function should linearly interpolate through time series with missing data if the time series does not exceed the thresholds defined by nodata_threshold.

nodata_threshold

A numeric vector of length 2. The first entry is the proportion of missing data points in each time series above which the function will not execute and return NA for all fields. The second entry is the number of consecutive missing data points above which the function will not execute and return NA for all fields.

return_bfast

A logical indicating if the BFAST results should be returned.

...

Arguments passed on to bfast.

Value

A bfast object (if return_bfast=TRUE) or nothing otherwise.

Examples

1
2
3
4
## Not run: 
bfast_interactve(mod.brick, monthly=TRUE, display=raster("C:/Desktop/Mojave.tif", add_layers=list(boundary), impute=TRUE, nodata_threshold=c(0.05, 3), h=0.05, breaks=5, season="harmonic", max.iter=5)

## End(Not run)

jnghiem/bfasttools documentation built on Nov. 4, 2019, 3:02 p.m.