Description Usage Arguments Details Value Examples
View source: R/plausibilityTest.R
Quantifies and plots the distribution of pixels within a mask over a reference categorical raster object.
1 | plausibilityTest(x, y, class.labels = NULL)
|
x |
Object of class RasterLayer and RasterStack. |
y |
Object of class RasterLayer. |
class.labels |
Labels of classes in y provided as a character vector. |
For each lazer in x, (e.g. classification mask) the function returns the absolute and relative count of non-NA pixels within each unique value of y (e.g. land cover map). Then, the results for each layer are compared in a combined plot. The output of the function is a list consisting of:
absolute.count - Absolute pixel count for each layer of x overlapping with each value of y.
relative.count - Relative pixel count for each layer of x overlapping with each value of y.
relative.plot - Plot comparing the relative pixel count of the layers in x within each value of y.
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)
# load example probability image
file <- system.file('extdata', 'probabilities.tif', package="rsMove")
p <- raster(file) > 0.5
# land cover map
lc <- raster(system.file('extdata', 'landCover.tif', package="rsMove"))
# segment probabilities
pt <- plausibilityTest(p, lc)
# show plot
pt$relative.plot
# see relative sample count
head(pt$relative.count)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.