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

The NaNs should be masked out at the time rast is defined, and not in each classification round.

parent ed1d5377
...@@ -71,6 +71,7 @@ sample_nb <- function(raster, ...@@ -71,6 +71,7 @@ sample_nb <- function(raster,
} else { } else {
rast <- raster rast <- raster
} }
rast <- raster::mask(rast, raster::calc(rast, fun = sum))
### ###
l <- 1 ###6. opt=260 l <- 1 ###6. opt=260
pbtn1 <- matrix(1, nrow = 1, ncol = 1) pbtn1 <- matrix(1, nrow = 1, ncol = 1)
......
...@@ -42,7 +42,6 @@ model_opt_r <- function(k, ...@@ -42,7 +42,6 @@ model_opt_r <- function(k,
points <- NULL points <- NULL
models <- NULL models <- NULL
oobe <- matrix(NA, nrow = n, ncol = 1) oobe <- matrix(NA, nrow = n, ncol = 1)
rast <- raster::mask(raster, raster::calc(raster, fun = sum))
for (j in 1:n) { for (j in 1:n) {
###Vorbereitung Klassifizierung ###Vorbereitung Klassifizierung
if (j == 1) { if (j == 1) {
......
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