Learn R Programming

rsMove (version 0.2.4)

plausibilityTest: plausibilityTest

Description

Quantifies and plots the distribution of pixels within a mask over a reference categorical raster object.

Usage

plausibilityTest(x, y, class.labels = NULL)

Arguments

x

Object of class raster and RasterStack with the x(s).

y

Reference raster (e.g. Land cover map).

class.labels

Labels of classes in y provided as a character vector.

Value

A list with statistical information on the distribution of samples per class and a comparative plot.

Details

For each lazer in x, the function returns the absolute and relative count of non-NA pixels in x within each class of y. 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 sample count for each layer of x within each class of y.

  • relative.count - Relative sample count for each layer of x within each class of y.

  • relative.plot - Plot comparing the relative sample count of the layers in x within each class of y.

Examples

Run this code
# NOT RUN {
{

 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)

}
# }

Run the code above in your browser using DataLab