Learn R Programming

sits (version 0.10.0)

plot.probs_cube: Generic interface for plotting probability cubes

Description

plots a probability cube using stars

Usage

# S3 method for probs_cube
plot(
  x,
  y,
  ...,
  time = 1,
  title = "Probabilities for Classes",
  breaks = "kmeans",
  colors = "YlGnBu",
  n_colors = 10
)

Arguments

x

object of class "probs_image"

y

ignored

...

further specifications for plot.

time

temporal reference for plot.

title

string.

breaks

type of breaks

colors

color palette.

n_colors

number of colors.

Value

The plot itself.

Examples

Run this code
# NOT RUN {
# Retrieve the samples for Mato Grosso
# select the bands for classification
samples_ndvi_evi <- sits_select(samples_mt_4bands, bands = c("EVI", "NDVI"))
# build the classification model
rfor_model <- sits_train(samples_ndvi_evi, sits_rfor(num_trees = 2000))

# select the bands "ndvi", "evi" provided by the SITS package
ndvi_file <- c(system.file("extdata/raster/mod13q1/sinop-ndvi-2014.tif",
    package = "sits"
))
evi_file <- c(system.file("extdata/raster/mod13q1/sinop-evi-2014.tif",
    package = "sits"
))
# select the timeline
data("timeline_2013_2014")
# build a data cube from files

sinop_2014 <- sits_cube(
    type = "BRICK",
    name = "sinop-2014",
    timeline = timeline_2013_2014,
    satellite = "TERRA",
    sensor = "MODIS",
    bands = c("ndvi", "evi"),
    files = c(ndvi_file, evi_file)
)

# classify the raster image
sinop_probs <- sits_classify(sinop_2014,
    rfor_model,
    output_dir = tempdir(),
    memsize = 4,
    multicores = 2
)

plot(sinop_probs)
# }

Run the code above in your browser using DataLab