Commit 58de1fee authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Remove variable which we do not need anymore so the garbage collector releases memory.

parent 7a30ebf9
......@@ -185,6 +185,9 @@ multi_Class_Sampling <- function(in.raster,
maFo_rf <- maFo[[as.numeric(decision)]]
index <- new.names[[as.numeric(decision)]]
acc <- new.acc[[as.numeric(decision)]]
remove(maFo)
remove(new.names)
remove(new.acc)
##########################################################################
} else{
########################
......@@ -230,6 +233,7 @@ multi_Class_Sampling <- function(in.raster,
sample2 <- init.samples
models2 <- nb_models
while (decision == "0") {
remove(maFo_rf)
decision2 <-
readline("Adjust init.samples/nb.models or auto [../.. or 0]: ")
if (decision2 != "0") {
......@@ -289,6 +293,7 @@ multi_Class_Sampling <- function(in.raster,
ni <- i
}
save(run1, file = paste(outPath, paste("Run", ni, sep = ""), sep = ""))
remove(run1)
###rgdal version issue
not_good_workaround <- comment(dummy@crs)
comment(dummy@crs) <- ""
......
......@@ -166,6 +166,7 @@ iplot <- function(x, y, HaTy, r, g, b, acc, outPath, plot_on_browser = TRUE) {
file = paste(outPath, 'leaflet.html', sep = ""),
append = TRUE
)
rm(mv)
if (plot_on_browser == TRUE) {
utils::browseURL(paste(outPath, 'leaflet.html', sep = ""),
browser = "firefox")
......@@ -180,6 +181,7 @@ iplot <- function(x, y, HaTy, r, g, b, acc, outPath, plot_on_browser = TRUE) {
htmlwidgets::saveWidget(mv,
selfcontained = FALSE,
paste(outPath, 'leaflet.html', sep = ""))
rm(mv)
cat(
"<style>.leaflet-container {cursor: crosshair !important;}</style>",
file = paste(outPath, 'leaflet.html', sep = ""),
......
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