The current approach only sets seeds for raster::randomSample and not for the raster::sampleRegular
The code in inner_procedure.r#L88:
if (class(init.seed) == "character" && init.seed == "sample") {
seed2 <- sample(c(1:1000000), size = nb_mean, replace = F)
} else {
seed2 <- init.seed
}
creates a list of seeds for the code in model_opt.r#L49:
if (sample_type == "random") {
set.seed(seed2[k])
pbt <-
raster::sampleRandom(raster, size = sample_size, sp = T)
}
if (sample_type == "regular") {
pbt <- raster::sampleRegular(raster, size = sample_size, sp = T)
}
- Why are the seeds set for
raster::sampleRandom
and not forraster::sampleRegular
?
Edited by Romulo Pereira Goncalves