bayes_plot_hist {bayesEO}R Documentation

Plot histogram

Description

Plot histogram

Usage

bayes_plot_hist(x, scale = 1, quantile = NULL, sample_size = 15000)

Arguments

x

SpatRaster to be plotted.

scale

Scale factor for SpatRaster

quantile

Threshold of values that will be plotted

sample_size

Number of samples to extract values

Value

A plot object

Author(s)

Gilberto Camara, gilberto.camara@inpe.br

Examples

if (bayes_run_examples()) {
    # get the probability file
    data_dir <- system.file("/extdata/probs/", package = "bayesEO")
    file <- list.files(data_dir)
    # read the probability file into a SpatRaster
    x <- terra::rast(paste0(data_dir, "/", file))
    # include the labels
    labels <- c("Water", "ClearCut_Burn", "ClearCut_Soil",
             "ClearCut_Veg", "Forest", "Wetland")
    # associate the labels to the names of the SpatRaster
    names(x) <- labels
    # calculate the variance
    v <- bayes_variance(x)
    # Plot the variance histogram
    bayes_hist(v, quantile = 0.75)
}


[Package bayesEO version 0.2.1 Index]