plot.uncertainty_cube | R Documentation |
plots a probability cube using stars
## S3 method for class 'uncertainty_cube'
plot(
x,
...,
tile = x$tile[[1]],
palette = "RdYlGn",
rev = TRUE,
tmap_options = NULL
)
x |
Object of class "probs_image". |
... |
Further specifications for plot. |
tile |
Tiles to be plotted. |
palette |
An RColorBrewer palette |
rev |
Reverse the color order in the palette? |
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) |
A plot object produced by the stars package with a map showing the uncertainty associated to each classified pixel.
Gilberto Camara, gilberto.camara@inpe.br
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()
)
# calculate uncertainty
uncert_cube <- sits_uncertainty(probs_cube, output_dir = tempdir())
# plot the resulting uncertainty cube
plot(uncert_cube)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.