compareLabel: compareLabel

Description Usage Arguments Details Value See Also Examples

View source: R/compareLabel.R

Description

Identifies samples that potentially require class label corrections.

Usage

1
compareLabel(x, y, x.label, y.label, na.count = 0, max.length = 0)

Arguments

x

Object of class data.frame with target profiles.

y

Object of class data.frame with reference profiles.

x.label

Character vector with classes of x.

y.label

Character vector with classes of y.

na.count

Maximum number of NA values accepted.

max.length

Maximum length of consecutive NA values accepted.

Details

The function cross-correlates x and y. Then,for each row, the function returns the element in y.label with the highest correlation. The final output of the function consists:

Note that na.count and max.length determine which observations are judged. If These thresholds are exceeded, the function will return NA.

Value

A list.

See Also

extractTS analyseTS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{

require(raster)
require(fieldRS)

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

# read field data
data(fieldData)
data(fieldDataTS)

a.ts <- analyseTS(as.data.frame(fieldDataTS$weighted.mean), fieldData$crop)

# extract reference profiles
rp <- as.data.frame(do.call(rbind, lapply(a.ts$y.statistics, function(i) {i$median})))

# compare labels
cl <- compareLabel(as.data.frame(fieldDataTS$weighted.mean), rp, fieldData$crop, a.ts$labels)

}

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