Last data update: 2014.03.03

R: flat2annual
flat2annualR Documentation

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)

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.

Details

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

Value

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

Author(s)

Liz Freeman

Examples

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ShapeSelectForest)
Loading required package: coneproj
Loading required package: raster
Loading required package: sp
Loading required package: rgdal
rgdal: version: 1.1-10, (SVN revision 622)
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 1.11.3, released 2015/09/16
 Path to GDAL shared files: /usr/share/gdal/1.11
 Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
 Path to PROJ.4 shared files: (autodetected)
 Linking to sp version: 1.2-3 
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ShapeSelectForest/flat2annual.Rd_%03d_medium.png", width=480, height=480)
> ### Name: flat2annual
> ### Title: flat2annual
> ### Aliases: flat2annual
> ### Keywords: models
> 
> ### ** Examples
> 
> 	# 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)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>