Commit 59f66cab authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Remove all the NaNs from the input raster.

parent f425b983
......@@ -42,6 +42,7 @@ model_opt_r <- function(k,
points <- NULL
models <- NULL
oobe <- matrix(NA, nrow = n, ncol = 1)
rast <- raster::mask(rast, raster::calc(rast, fun = sum))
for (j in 1:n) {
###Vorbereitung Klassifizierung
if (j == 1) {
......@@ -54,10 +55,10 @@ model_opt_r <- function(k,
if (sample_type == "regular") {
pbt <- raster::sampleRegular(raster, size = sample_size, sp = T)
}
f <- which(is.na(pbt@data[1]))
if (length(f) != 0) {
pbt <- pbt[-f,]
}
#f <- which(is.na(pbt@data[1]))
#if (length(f) != 0) {
# pbt <- pbt[-f,]
#}
set.seed(seed2[k])
classes <-
as.factor(sample(c(1:2), size = nrow(pbt), replace = T))
......
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