Commit 903261da authored by carstennh's avatar carstennh
Browse files

optimize processing time in the sampling routine of model_opt.r

parent 2faeec0d
......@@ -58,11 +58,11 @@ model_opt_r <- function(k,
}
pbt <- spatialEco::point.in.poly(pbt, area)[, 1:n_channel]
#f <- which(is.na(pbt@data[1]))
#if (length(f) != 0) {
# pbt <- pbt[-f,]
#}
pbt@data <- pbt@data[complete.cases(pbt@data[1]), ]
f <- which(is.na(pbt@data[1]))
if (length(f) != 0) {
pbt <- pbt[-f,]
}
set.seed(seed2[k])
classes <-
......
  • the substitute in line 65 in model_opt.r pbt@data <- pbt@data[complete.cases(pbt@data[1]), ] is not working!!! It causes a wrong row selection in line 143 since pbt@data does not change the coordinates of the entire pbt object

  • @carstenn That's a good catch. I went through the commit history and I can't understand from where such change comes from. The code on this file should have been a copy and paste from the inner_procedure file. Since the code is commented, maybe it was an experiment and the change was committed by mistake.

Supports Markdown
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