From 0c59e4dd8e3a2c0c8a18ca501e08062abeb9c5eb Mon Sep 17 00:00:00 2001
From: Maria Voigt <maria.voigt@idiv.de>
Date: Mon, 22 May 2017 19:10:01 +0200
Subject: [PATCH] fixing problem in assigning the right number of grid cells in
 cv

---
 src/model_fitting/abundance_model.R | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/model_fitting/abundance_model.R b/src/model_fitting/abundance_model.R
index 53ff0f6..c11cd69 100644
--- a/src/model_fitting/abundance_model.R
+++ b/src/model_fitting/abundance_model.R
@@ -310,7 +310,7 @@ if (!is.na(exclude_grid)){
 if (!is.na(exclude_grid_rand)){
  #bin_id --> randomly exclude percentage given in grid_rand
   ids_to_exclude <- sample(predictors_obs$bin_id,
-                           size = nrow(predictors_obs)/100 * exclude_grid_rand,
+                           size = nrow(predictors_obs)/100 * exclude_grid_rand_perc,
                            replace = FALSE)
 
   predictors_excluded_grid_rand <- predictors_obs[predictors_obs$bin_id %in% ids_to_exclude, ]
-- 
GitLab