if (bayes_run_examples()) {
# get the probability file
data_dir <- system.file("/extdata/probs/", package = "bayesEO")
file <- list.files(data_dir)
# build the full path
probs_file <- 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
probs <- bayes_read_probs(probs_file, labels)
# Plot the probability image
bayes_plot_probs(probs,
scale = 0.0001,
tmap_scale = 1.0)
}
Run the code above in your browser using DataLab