Learn R Programming

ShapeSelectForest (version 1.7)

flat2annual: flat2annual

Description

Identifies the disturbance year of a single pixel or a plot location.

Usage

flat2annual(years, all.shapes, all.durs, all.dyrs, mtbs, flat.pred)

Value

Returns a vector of the same length as years with a predicted agent for each year in years.

Arguments

years

Vector of the years included in the time series data.

all.shapes

Vector (length 4) of the shapes of the four remote sensing bands. Shape values range from 1 to 7.

all.durs

Vector (length 4) of the duration of each shape.

all.dyrs

Vector (length 4) of the year of each shape.

mtbs

MTBS

flat.pred

Predicted disturbance Agent. Agent values range from 0 to 6.

Author

Liz Freeman

Details

flat2annual can be used on either a single pixel or on a single data point in a data frame.

Examples

Run this code
	# define years
	years <- c(2001:2010)

	# define parameters
	all.shapes <- c(1, 4, 5, 3)
	all.dyrs <- c(2001, 0, 2004, 2004)
	all.durs <- c(1, 0, 3, 5)
	flat.pred <- 5

	# call flat2annual
	ans <- flat2annual(years = years, all.shapes = all.shapes, all.durs = all.durs,
	all.dyrs = all.dyrs, mtbs = mtbs, flat.pred = flat.pred)

Run the code above in your browser using DataLab