Commit ac68e813 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

User can now decided if the runs are saved or not.

parent 6aa47b26
......@@ -21,13 +21,14 @@
#' @param multiTest number of test runs to compare different probability outputs
#' @param RGB rgb channel numbers for image plot
#' @param overwrite overwrite the results file
#' @param save_runs if it saves the Habitat object or not (default TRUE)
#' @param parallel_mode run loops using all available cores
#' @param plot_on_browser plot on the browser or inline in a notebook (default TRUE)
#'
#' @return 4 files per step:
#' 1) Habitat type probability map as geocoded *.kml layer and *.tif raster files and *.png image output
#' 2) A Habitat object 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@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels [1,2] for each selected model \cr
#' run1@switch - vector of lenght run1@models indicating if target class equals 2, if not NA the labels need to be switched \cr
......@@ -84,6 +85,7 @@ multi_Class_Sampling <- function(in.raster,
multiTest = 1,
RGB = c(19, 20, 21),
overwrite = TRUE,
save_runs = TRUE,
parallel_mode = FALSE,
plot_on_browser = TRUE) {
###first steps: data preparation
......@@ -286,14 +288,17 @@ multi_Class_Sampling <- function(in.raster,
readline("Threshold for Habitat Extraction or Sample Again [../0]: ")
}
run1 <- maFo_rf
if (i < 10) {
ni <- paste("0", i, sep = "")
} else{
ni <- i
}
save(run1, file = paste(outPath, paste("Run", ni, sep = ""), sep = ""))
remove(run1)
if ( save_runs == TRUE) {
run1 <- maFo_rf
save(run1, file = paste(outPath, paste("Run", ni, sep = ""), sep = ""))
remove(run1)
}
###rgdal version issue
not_good_workaround <- comment(dummy@crs)
comment(dummy@crs) <- ""
......
......@@ -24,6 +24,7 @@ multi_Class_Sampling(
multiTest = 1,
RGB = c(19, 20, 21),
overwrite = TRUE,
save_runs = TRUE,
parallel_mode = FALSE,
plot_on_browser = TRUE
)
......@@ -67,6 +68,8 @@ multi_Class_Sampling(
\item{overwrite}{overwrite the results file}
\item{save_runs}{if it saves the Habitat object or not (default TRUE)}
\item{parallel_mode}{run loops using all available cores}
\item{plot_on_browser}{plot on the browser or inline in a notebook (default TRUE)}
......@@ -75,7 +78,7 @@ multi_Class_Sampling(
4 files per step:
\enumerate{
\item Habitat type probability map as geocoded *.kml layer and *.tif raster files and *.png image output
\item A Habitat object 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@ref_samples - list of SpatialPointsDataFrames with same length as run1@models holding reference labels \link{1,2} for each selected model \cr
run1@switch - vector of lenght run1@models indicating if target class equals 2, if not NA the labels need to be switched \cr
......
Supports Markdown
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