From 0dcba3ce757084c4b9ad4cfc7471813d2efc2c53 Mon Sep 17 00:00:00 2001 From: Insang Song Date: Tue, 12 Nov 2024 19:53:04 +0900 Subject: [PATCH 1/4] 1.1.4patch - process_geos: paths are searched recursively - skip_merge is getting the explicit `by` argument value --- R/calculate_covariates.R | 2 +- R/process.R | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/R/calculate_covariates.R b/R/calculate_covariates.R index 0d40c63b..bc6daf32 100644 --- a/R/calculate_covariates.R +++ b/R/calculate_covariates.R @@ -1521,7 +1521,7 @@ calculate_hms <- function( paste0("medium_", radius), paste0("heavy_", radius) ) - skip_merge <- merge(locs, skip_df) + skip_merge <- merge(locs, skip_df, by = "time") skip_return <- calc_return_locs( skip_merge, POSIXt = TRUE, diff --git a/R/process.R b/R/process.R index 7693b5ea..d8dc15c5 100644 --- a/R/process.R +++ b/R/process.R @@ -2091,12 +2091,11 @@ process_geos <- paths <- list.files( path, pattern = "GEOS-CF.v01.rpl", - full.names = TRUE + full.names = TRUE, + recursive = TRUE ) - paths <- paths[grep( - ".nc4", - paths - )] + paths <- grep(".nc4$", paths, value = TRUE) + #### identify dates based on user input dates_of_interest <- generate_date_sequence( date[1], From b961ac3ab898fbae55f70b7d40559b345f5146c7 Mon Sep 17 00:00:00 2001 From: Insang Song Date: Tue, 12 Nov 2024 21:13:57 +0900 Subject: [PATCH 2/4] calculate_hms fix - skip_merge part will result in dimension mismatch error when `from` is character(n) --- R/calculate_covariates.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/calculate_covariates.R b/R/calculate_covariates.R index bc6daf32..89044f9e 100644 --- a/R/calculate_covariates.R +++ b/R/calculate_covariates.R @@ -1521,7 +1521,14 @@ calculate_hms <- function( paste0("medium_", radius), paste0("heavy_", radius) ) - skip_merge <- merge(locs, skip_df, by = "time") + # fixed: locs is replicated per the length of from + skip_merge <- + Reduce(rbind, + Map(function(x) { + cbind(locs, skip_df[rep(x, nrow(locs)), ]) + }, seq_len(nrow(skip_df))) + ) + skip_return <- calc_return_locs( skip_merge, POSIXt = TRUE, From cc959393dc9268a90f820823bffd71b8af0941bd Mon Sep 17 00:00:00 2001 From: Insang Song Date: Fri, 15 Nov 2024 11:49:48 +0900 Subject: [PATCH 3/4] lint --- R/calculate_covariates.R | 2 +- R/download_auxiliary.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/calculate_covariates.R b/R/calculate_covariates.R index 89044f9e..f5c90299 100644 --- a/R/calculate_covariates.R +++ b/R/calculate_covariates.R @@ -1528,7 +1528,7 @@ calculate_hms <- function( cbind(locs, skip_df[rep(x, nrow(locs)), ]) }, seq_len(nrow(skip_df))) ) - + skip_return <- calc_return_locs( skip_merge, POSIXt = TRUE, diff --git a/R/download_auxiliary.R b/R/download_auxiliary.R index 23c4a04a..937f2093 100644 --- a/R/download_auxiliary.R +++ b/R/download_auxiliary.R @@ -575,4 +575,4 @@ check_destfile <- function(destfile) { } else { return(FALSE) } -} \ No newline at end of file +} From 959dad24aff2b4c38f141cf1841ce29121699fb9 Mon Sep 17 00:00:00 2001 From: mitchellmanware Date: Fri, 15 Nov 2024 08:34:49 -0500 Subject: [PATCH 4/4] 1.1.7 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e1252097..f99bfc42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: amadeus Title: Accessing and Analyzing Large-Scale Environmental Data -Version: 1.1.6 +Version: 1.1.7 Authors@R: c( person(given = "Mitchell", family = "Manware", role = c("aut", "ctb"), comment = c(ORCID = "0009-0003-6440-6106")), person(given = "Insang", family = "Song", role = c("aut", "ctb"), comment = c(ORCID = "0000-0001-8732-3256")),