Learn R Programming

CAWaR (version 0.0.2)

phenoCropClass: phenoCropClass

Description

Spatially explicit and phenology driven classification scheme for cropland mapping.

Usage

phenoCropClass(x, y, z, match = FALSE)

Arguments

x

A matrix or data.frame.

y

A character vector.

z

A numeric element. Default is 1.

match

logical argument.

Value

A list containing a set of reference profiles for each unique class in y.

Details

Correlates x with each row in y. The row in y with the highest correlation is reported as the selected class. If match is set to TRUE the function will use Dynamic Time Wrapping (DTW) x and y at each iteration. z sets the temporal buffer used to search to matching data points. The final output is a data.frame containing:

  • r2 - \(R^{2}\) between x and each row y.

  • count - Number of records used to estimate the \(R^{2}\).

  • max.interval - Maximum gap between data points when NA values exist.

See Also

analyseTS phenoCropVal

Examples

Run this code
# NOT RUN {
{

require(fieldRS)

# read reference profiles
data(referenceProfiles)

# target time series
x <- c(2200, 4500, 4600, 6400, 1600)
y <- referenceProfiles[,2:6]

# Perform classification
c <-phenoCropClass(x, y)
head(c)

}
# }

Run the code above in your browser using DataLab