plot.variance_cube: Plot variance cubes

View source: R/sits_plot.R

plot.variance_cubeR Documentation

Plot variance cubes

Description

plots a probability cube using stars

Usage

## S3 method for class 'variance_cube'
plot(
  x,
  ...,
  tile = x$tile[[1]],
  labels = NULL,
  palette = "YlGnBu",
  rev = FALSE,
  type = "map",
  tmap_options = NULL
)

Arguments

x

Object of class "variance_cube".

...

Further specifications for plot.

tile

Tile to be plotted.

labels

Labels to plot (optional).

palette

RColorBrewer palette

rev

Reverse order of colors in palette?

type

Type of plot ("map" or "hist")

tmap_options

Named list with optional tmap parameters max_cells (default: 1e+06) scale (default: 1.0) graticules_labels_size (default: 0.7) legend_title_size (default: 1.0) legend_text_size (default: 1.0) legend_bg_color (default: "white") legend_bg_alpha (default: 0.5)

Value

A plot containing probabilities associated to each class for each pixel.

Author(s)

Gilberto Camara, gilberto.camara@inpe.br

Examples

if (sits_run_examples()) {
    # create a random forest model
    rfor_model <- sits_train(samples_modis_ndvi, sits_rfor())
    # create a data cube from local files
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6",
        data_dir = data_dir
    )
    # classify a data cube
    probs_cube <- sits_classify(
        data = cube, ml_model = rfor_model, output_dir = tempdir()
    )
    # obtain a variance cube
    var_cube <- sits_variance(probs_cube, output_dir = tempdir())
    # plot the variance cube
    plot(var_cube)
}


e-sensing/sits documentation built on Jan. 28, 2024, 6:05 a.m.