phenoCropVal: phenoCropVal

Description Usage Arguments Details Value See Also Examples

View source: R/phenoCropVal.R

Description

Spatially explicit and phenology driven validation scheme for cropland mapping.

Usage

1
phenoCropVal(x, y, z)

Arguments

x

A matrix or data.frame.

y

A character vector.

z

A character vector.

Details

For each unique class in y, the function iterates through each unique element in z and keeps it for validation. Then, it calls analyseTS to derive reference profiles for each unique class in y and uses them to classify the validation samples using phenoCropClass. The final output consists of:

Value

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

See Also

extractTS phenoCropClass

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
32
{

require(raster)
require(fieldRS)

# read raster data
r <- brick(system.file("extdata", "ndvi.tif", package="fieldRS"))

# read field data
data(fieldData)

# read reference profiles
data(referenceProfiles)

# read time series
data(fieldDataTS)
fieldDataTS <- as.data.frame(fieldDataTS$weighted.mean)

# read info. on sample spatial grouping
data(fieldDataCluster)

# derive validation results
cropVal <- phenoCropVal(fieldDataTS, fieldData$crop, fieldDataCluster$region.id)

# plot accuracy results
cropVal$accuracy.plot

# plot correctly classified polygons in red
plot(fieldData)
plot(fieldData[cropVal$sample.validation,], col="red", add=TRUE)

}

CAWaR documentation built on July 8, 2020, 7:06 p.m.