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

Use rast in all operations.

parent 1486a19e
...@@ -50,10 +50,10 @@ model_opt_r <- function(k, ...@@ -50,10 +50,10 @@ model_opt_r <- function(k,
if (sample_type == "random") { if (sample_type == "random") {
set.seed(seed2[k]) set.seed(seed2[k])
pbt <- pbt <-
raster::sampleRandom(raster, size = sample_size, sp = T) raster::sampleRandom(rast, size = sample_size, sp = T)
} }
if (sample_type == "regular") { if (sample_type == "regular") {
pbt <- raster::sampleRegular(raster, size = sample_size, sp = T) pbt <- raster::sampleRegular(rast, size = sample_size, sp = T)
} }
#f <- which(is.na(pbt@data[1])) #f <- which(is.na(pbt@data[1]))
#if (length(f) != 0) { #if (length(f) != 0) {
...@@ -156,7 +156,7 @@ model_opt_r <- function(k, ...@@ -156,7 +156,7 @@ model_opt_r <- function(k,
if (ncol(test1) == 1) { if (ncol(test1) == 1) {
test1 <- t(test1) test1 <- t(test1)
} }
colnames(test1) <- names(raster) colnames(test1) <- names(rast)
} }
if (class(test1)[1] == "numeric") { if (class(test1)[1] == "numeric") {
test1 <- t(matrix(test1)) test1 <- t(matrix(test1))
......
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