From fdaec415b391c4cdaf6705bcb3a1a0a2ede0f931 Mon Sep 17 00:00:00 2001 From: Andrea Manica Date: Fri, 8 Sep 2023 22:10:57 +0100 Subject: [PATCH] Note on fixing future monthly --- R/download_worldclim_future.R | 1 + data-raw/helper_functions/verify_files_by_dataset.R | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/R/download_worldclim_future.R b/R/download_worldclim_future.R index 35fa4bda..26cc626a 100644 --- a/R/download_worldclim_future.R +++ b/R/download_worldclim_future.R @@ -77,6 +77,7 @@ download_worldclim_future <- function(dataset, bio_var, filename){ sds_list[[i_var]]<-terra::rast(lapply(wc_list, terra::subset,subset=i_var)) names(sds_list[[i_var]])<-rep(i_var,nlyr((sds_list[[i_var]]))) } + browser() wc_sds <- terra::sds(sds_list) terra::writeCDF(wc_sds,filename=filename, compression=9, diff --git a/data-raw/helper_functions/verify_files_by_dataset.R b/data-raw/helper_functions/verify_files_by_dataset.R index 4cbaea18..38b63941 100644 --- a/data-raw/helper_functions/verify_files_by_dataset.R +++ b/data-raw/helper_functions/verify_files_by_dataset.R @@ -21,3 +21,8 @@ if (any(problem_rows)){ } else { cat("all files are fine") } + + +### There is a problem with how we are renaming variables when downloading future worldclim +# monthly variables (it's not working) +# check line 78