From 0fd9bb1e23801676b8265a5e1d50612278736e0f Mon Sep 17 00:00:00 2001 From: tanerumit Date: Tue, 23 Jan 2024 11:58:16 +0100 Subject: [PATCH] improve sampling of grids in evaluateWegen --- R/generateWeatherSeries.R | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/R/generateWeatherSeries.R b/R/generateWeatherSeries.R index 7d36b8f..11e30a6 100644 --- a/R/generateWeatherSeries.R +++ b/R/generateWeatherSeries.R @@ -300,14 +300,8 @@ generateWeatherSeries <- function( if(evaluate.model) { - # Sample evenly from the grid cells - #sampleGrids <- sf::st_as_sf(weather.grid[,c("x","y")], coords=c("x","y")) %>% - # sf::st_sample(size = min(evaluate.grid.num, ngrids), type="regular") %>% - # sf::st_cast("POINT") %>% sf::st_coordinates() %>% as_tibble() %>% - # left_join(weather.grid[,c("x","y","id")], by = c("X"="x","Y"="y")) %>% - # pull(id) - - sampleGrids <- 1:(min(evaluate.grid.num, ngrids)) + sampleGrids