Description Usage Arguments Details Value See Also Examples
Identifies samples that potentially require class label corrections.
1 | compareLabel(x, y, x.label, y.label, na.count = 0, max.length = 0)
|
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. |
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:
cross.cor - Median, minimum and maximum values for each column in x over each unique class in y.
label.compare - data.frame showing y.label and the best match in y.label.
na.stats - data.frame showing the count and maximum number of consecutive NA values for each row in x.
Note that na.count and max.length determine which observations are judged. If These thresholds are exceeded, the function will return NA.
A list.
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.