if (bayes_run_examples()) {
# Define location of a probability file
data_dir <- system.file("/extdata/probs",
package = "bayesEO")
# list the file
file <- list.files(data_dir)
# build the full path
probs_file <- paste0(data_dir, "/", file)
# define labels
labels <- c("Water", "ClearCut_Burn", "ClearCut_Soil",
"ClearCut_Veg", "Forest", "Wetland")
probs_image <- bayes_read_probs(probs_file, labels)
# Label the probs image
y <- bayes_label(x)
# produce a map of the labelled image
bayes_plot_map(y)
}
Run the code above in your browser using DataLab