Learn R Programming

rsMove (version 0.2.8)

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 RasterLayer and RasterStack.

y

Object of class RasterLayer.

class.labels

Labels of classes in y provided as a character vector.

Value

A list.

Details

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.

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