From ae2019bfffc72738415a6263fe2c35a34e89f4de Mon Sep 17 00:00:00 2001 From: Maria Voigt <maria.voigt@idiv.de> Date: Thu, 27 Apr 2017 21:17:33 +0200 Subject: [PATCH] deleting the indexing of grid_exclude --- src/model_fitting/abundance_model.R | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/model_fitting/abundance_model.R b/src/model_fitting/abundance_model.R index e8df2c3..a71426e 100644 --- a/src/model_fitting/abundance_model.R +++ b/src/model_fitting/abundance_model.R @@ -273,11 +273,6 @@ saveRDS(predictors_obs, file = file.path(outdir, paste0("predictors_observation_ name_suffix, Sys.Date(), ".rds"))) -#exclude_grid is an index (1:82) that needs to be translated into the actual index of the cell -#DONT WANT TO HAVE THIS; THIS SUCKS -grid_cell_nrs <- unique(predictors_obs$grid_id) -grid_cell_nr <- grid_cell_nrs[exclude_grid] - # now exclude the year that needs to be excluded if (!is.na(exclude_year)){ @@ -286,8 +281,8 @@ if (!is.na(exclude_year)){ # or the grid_cell if (!is.na(exclude_grid)){ - predictors_excluded_grid <- predictors_obs[predictors_obs$grid_id == grid_cell_nr, ] - predictors_obs <- predictors_obs[predictors_obs$grid_id != grid_cell_nr, ] + predictors_excluded_grid <- predictors_obs[predictors_obs$grid_id == exclude_grid, ] + predictors_obs <- predictors_obs[predictors_obs$grid_id != exclude_grid, ] } # also we increase maxit for the two cases, -- GitLab