From 367b31b8446a196301f2565a896940767be23684 Mon Sep 17 00:00:00 2001 From: Dan McGraw Date: Tue, 21 Apr 2026 15:27:51 -0600 Subject: [PATCH 1/4] Update Authors@R with contributors and reviewers --- DESCRIPTION | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5e9f9a5..9e0cd96 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,13 @@ Authors@R: c( person("Samantha", "Hartke", , "samantha.h.hartke@usace.army.mil", role = "ctb", comment = "PhD, USACE RMC"), person("Julian", "Gonzalez", , "julian.t.gonzalez@usace.army.mil", - role = "ctb", comment = "USACE RMC")) + role = "ctb", comment = "USACE RMC"), + person("Sadie", "Niblett", , "sadie.[...]@usace.army.mil", + role = "rev", comment = "USACE RMC"), + person("Reuben", "Sasaki", , "reuben.[...]@usace.army.mil", + role = "rev", comment = "USACE RMC"), + person("Bryan", "Robinson", , "bryan.[...]@usace.army.mil", + role = "rev", comment = "USACE RMC")) Description: An R implementation of the U.S. Army Corps of Engineers (USACE) Risk Management Center-Reservoir Frequency Analysis (RMC-RFA) methodology/software. This package produces reservoir stage-frequency curves with uncertainty bounds From b630af2f6f23f4027abe5b2b944c6d1504df7724 Mon Sep 17 00:00:00 2001 From: Dan McGraw Date: Tue, 21 Apr 2026 15:38:53 -0600 Subject: [PATCH 2/4] Correct reviewer email addresses --- DESCRIPTION | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e0cd96..d36909c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,12 +14,12 @@ Authors@R: c( role = "ctb", comment = "PhD, USACE RMC"), person("Julian", "Gonzalez", , "julian.t.gonzalez@usace.army.mil", role = "ctb", comment = "USACE RMC"), - person("Sadie", "Niblett", , "sadie.[...]@usace.army.mil", + person("Sadie", "Niblett", , "sadie.s.niblett@usace.army.mil", role = "rev", comment = "USACE RMC"), - person("Reuben", "Sasaki", , "reuben.[...]@usace.army.mil", - role = "rev", comment = "USACE RMC"), - person("Bryan", "Robinson", , "bryan.[...]@usace.army.mil", - role = "rev", comment = "USACE RMC")) + person("Reuben", "Sasaki", , "reuben.a.sasaki@usace.army.mil", + role = "rev", comment = "P.E.,USACE RMC"), + person("Bryan", "Robinson", , "bryan.j.robinson@usace.army.mil", + role = "rev", comment = "P.E.,USACE RMC")) Description: An R implementation of the U.S. Army Corps of Engineers (USACE) Risk Management Center-Reservoir Frequency Analysis (RMC-RFA) methodology/software. This package produces reservoir stage-frequency curves with uncertainty bounds From 01b96508d3abd3cf83028e9b635ec5088d87e671 Mon Sep 17 00:00:00 2001 From: Dan McGraw Date: Mon, 11 May 2026 22:04:04 -0600 Subject: [PATCH 3/4] add thin_samples() to utils --- R/utils.R | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/R/utils.R b/R/utils.R index e668606..c75e092 100644 --- a/R/utils.R +++ b/R/utils.R @@ -8,6 +8,26 @@ power_function <- function(x) { 10^(1:x) } -# power_function <- function(x) { -# as.integer(outer(c(1), 10^(1:x))) -# } +#' Thin samples +#' Thin a large sample of sorted z-scores and stages for efficiency. +#' Retains 5,000 evenly-spaced points across the full range plus the last +#' 10,000 points for dense coverage at the extreme tail. +#' +#' @param n Total number of samples +#' @param z_sorted Sorted z-scores (ascending), length n +#' @param stage_sorted Sorted stage values (ascending), length n +#' @return A tibble with columns z_aep and stage +thin_samples <- function(n, z_sorted, stage_sorted) { + + thin_idx <- unique(c( + round(seq(1, n, length.out = 5000)), + (n - 10000):n + )) + thin_idx <- sort(unique(thin_idx)) + thin_idx <- thin_idx[thin_idx >= 1 & thin_idx <= n] + + tibble( + z_aep = z_sorted[thin_idx], + stage = stage_sorted[thin_idx] + ) +} From 140fc179b763a82faf4e03ff00b8317d19f225bb Mon Sep 17 00:00:00 2001 From: Dan McGraw Date: Mon, 11 May 2026 22:27:35 -0600 Subject: [PATCH 4/4] fix tibble NOTE in thin_samples --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index c75e092..f680e4d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -26,7 +26,7 @@ thin_samples <- function(n, z_sorted, stage_sorted) { thin_idx <- sort(unique(thin_idx)) thin_idx <- thin_idx[thin_idx >= 1 & thin_idx <= n] - tibble( + data.frame( z_aep = z_sorted[thin_idx], stage = stage_sorted[thin_idx] )