Commit 2ef3dc22 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Merge branch 'master' into saveSamplePoints

parents 5cf2a9ca 45ef975f
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#' @param plot_on_browser plot on the browser or inline in a notebook (default TRUE) #' @param plot_on_browser plot on the browser or inline in a notebook (default TRUE)
#' #'
#' @return 4 files per step: #' @return 4 files per step:
#' 1) Habitat type probability map as geocoded *.kml layer and *.tif raster files and *.png image output #' 1) Habitat type probability map as geocoded *.kmz file (with a *.kml layer and *.png image output), and *.tif raster file
#' 2) A Habitat object (only if save_runs is set to TRUE) consisting of 7 slots: \cr #' 2) A Habitat object (only if save_runs is set to TRUE) consisting of 7 slots: \cr
#' run1@models - list of selcted classifiers \cr #' run1@models - list of selcted classifiers \cr
#' run1@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels [1,2] for each selected model \cr #' run1@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels [1,2] for each selected model \cr
......
...@@ -12,6 +12,23 @@ ...@@ -12,6 +12,23 @@
#' #'
#' @export #' @export
plot_results <- function(inPath, color = NULL) { plot_results <- function(inPath, color = NULL) {
num_files <- length(list.files(
inPath,
pattern = ".kmz$",
all.files = FALSE,
include.dirs = TRUE,
no.. = TRUE
))
if (num_files == 0) {
num_files <- length(list.files(
inPath,
pattern = ".kml$",
all.files = FALSE,
include.dirs = TRUE,
no.. = TRUE
))
}
# Compares the number of .png to that of step_*.tif. If step_*.tif files are missing the # Compares the number of .png to that of step_*.tif. If step_*.tif files are missing the
# user's attention is drawn. # user's attention is drawn.
...@@ -21,14 +38,8 @@ plot_results <- function(inPath, color = NULL) { ...@@ -21,14 +38,8 @@ plot_results <- function(inPath, color = NULL) {
all.files = FALSE, all.files = FALSE,
include.dirs = TRUE, include.dirs = TRUE,
no.. = TRUE no.. = TRUE
)) != length(list.files( )) != num_files) {
inPath, message("Make sure the number of the step_*.tif files fits to the number of the step_*.km(l|z) files and that
pattern = ".png$",
all.files = FALSE,
include.dirs = TRUE,
no.. = TRUE
))) {
message("Make sure the number of the step_*.tif files fits to the number of the .png files and that
there are no other files from previous runs. there are no other files from previous runs.
If you have resumed a run, then the data of the aborted and the continued run needs If you have resumed a run, then the data of the aborted and the continued run needs
to be in the Results directory. You need them for plotting the classification map.") to be in the Results directory. You need them for plotting the classification map.")
......
...@@ -83,7 +83,7 @@ multi_Class_Sampling( ...@@ -83,7 +83,7 @@ multi_Class_Sampling(
\value{ \value{
4 files per step: 4 files per step:
\enumerate{ \enumerate{
\item Habitat type probability map as geocoded *.kml layer and *.tif raster files and *.png image output \item Habitat type probability map as geocoded *.kmz file (with a *.kml layer and *.png image output), and *.tif raster file
\item A Habitat object (only if save_runs is set to TRUE) consisting of 7 slots: \cr \item A Habitat object (only if save_runs is set to TRUE) consisting of 7 slots: \cr
run1@models - list of selcted classifiers \cr run1@models - list of selcted classifiers \cr
run1@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels \link{1,2} for each selected model \cr run1@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels \link{1,2} for each selected model \cr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment