Skip to content

Commit 2e80234

Browse files
committed
docs: resolve #4 (dontrun audit, missing examples, related cleanup)
Audit of \dontrun{} usage: - Remove wrappers from aep2stage, stage2aep, bootstrap_vfc, flow_frequency_sampler_expected, hydrograph_setup - Add @details to stage2aep documenting expected approx() ties warning - Add inline GEV/LP3 comments to bootstrap_vfc - Keep wrapper on rfa_simulate with runtime comment Bug fix: rfa_simulate Expected-mode example used jmd_vfc_parameters (single posterior mode row) where Nbin*Mevent rows are required. Swapped to jmd_bf_parameter_sets across all three modes. Missing examples: added example and @return to theme_rfar_conceptual (was rendering blank). Internal helpers (interpolate_aep_matrix, interpolate_stage_matrix, stage_frequency_curve) intentionally left unexposed per @Keywords i
1 parent f3925c3 commit 2e80234

10 files changed

Lines changed: 101 additions & 25 deletions

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ Depends:
4444
LazyData: true
4545
Suggests:
4646
gt,
47-
ggplot2,
4847
knitr,
4948
rmarkdown,
5049
scales,
5150
testthat (>= 3.0.0),
52-
tidyverse,
5351
dplyr,
5452
tidyr,
5553
kableExtra,
@@ -60,6 +58,7 @@ Imports:
6058
cli,
6159
future,
6260
future.apply,
61+
ggplot2,
6362
lmom,
6463
lubridate,
6564
progressr,

R/data.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@
206206
#'
207207
#' Inflow hydrograph shape from May 1955 flood event.
208208
#'
209-
#' @format A data frame with 241 rows and 2 columns:
209+
#' @format A data frame with 241 rows and 4 columns:
210210
#' \describe{
211211
#' \item{Ordinate}{Timeseries Ordinate}
212212
#' \item{Date}{Date mm/dd/yyyy}
213213
#' \item{Time}{Time in 00:00}
214214
#' \item{Flow}{Inflow (cfs)}
215215
#' }
216216
#' @examples
217-
#' sapply(jmd_hydro_may1955,class)
217+
#' sapply(jmd_hydro_may1955, class)
218218
#' head(jmd_hydro_may1955)
219219
#' plot(jmd_hydro_may1955$Ordinate, jmd_hydro_may1955$Flow,
220220
#' xlab = "Hour", ylab = "Inflow (cfs)",
@@ -225,15 +225,15 @@
225225
#'
226226
#' Inflow hydrograph shape for Probable Maximum Flood (PMF).
227227
#'
228-
#' @format A data frame with 192 rows and 2 columns:
228+
#' @format A data frame with 192 rows and 4 columns:
229229
#' \describe{
230230
#' \item{Ordinate}{Timeseries Ordinate}
231231
#' \item{Date}{Date mm/dd/yyyy}
232232
#' \item{Time}{Time in 00:00}
233233
#' \item{Flow}{Inflow (cfs)}
234234
#' }
235235
#' @examples
236-
#' sapply(jmd_hydro_pmf,class)
236+
#' sapply(jmd_hydro_pmf, class)
237237
#' head(jmd_hydro_pmf)
238238
#' plot(jmd_hydro_pmf$Ordinate, jmd_hydro_pmf$Flow,
239239
#' xlab = "Hour", ylab = "Inflow (cfs)",
@@ -244,15 +244,15 @@
244244
#'
245245
#' Inflow hydrograph shape for Spillway Design Flood (SDF).
246246
#'
247-
#' @format A data frame with 337 rows and 2 columns:
247+
#' @format A data frame with 337 rows and 4 columns:
248248
#' \describe{
249249
#' \item{Ordinate}{Timeseries Ordinate}
250250
#' \item{Date}{Date mm/dd/yyyy}
251251
#' \item{Time}{Time in 00:00}
252252
#' \item{Flow}{Inflow (cfs)}
253253
#' }
254254
#' @examples
255-
#' sapply(jmd_hydro_sdf,class)
255+
#' sapply(jmd_hydro_sdf, class)
256256
#' head(jmd_hydro_sdf)
257257
#' plot(jmd_hydro_sdf$Ordinate, jmd_hydro_sdf$Flow,
258258
#' xlab = "Hour", ylab = "Inflow (cfs)",

R/plotting_utils.R

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1-
#' rfaR ggplot theme for conceptual example
1+
#' rfaR ggplot2 Theme for Conceptual Plots
2+
#'
3+
#' A custom \pkg{ggplot2} theme used in the rfaR conceptual realization
4+
#' vignette. Based on \code{\link[ggplot2]{theme_bw}} with tightened text
5+
#' sizes, italic titles, and the legend suppressed. Intended for figures
6+
#' that emphasize curves over annotation density.
7+
#'
8+
#' @return A \pkg{ggplot2} theme object that can be added to a \code{ggplot}
9+
#' via \code{+}.
210
#'
3-
#' custom ggplot2 theme for rfaR-Realization-Conceptual.Rmd
411
#' @export
12+
#'
13+
#' @seealso \code{\link[ggplot2]{theme_bw}}
14+
#'
15+
#' @examples
16+
#' library(ggplot2)
17+
#' ggplot(jmd_rfa_expected, aes(x = AEP, y = Expected)) +
18+
#' geom_line() +
19+
#' scale_x_continuous(transform = c("log10", "reverse")) +
20+
#' labs(title = "JMD Expected Stage-Frequency",
21+
#' subtitle = "Demonstrating theme_rfar_conceptual()",
22+
#' x = "AEP", y = "Stage (ft)") +
23+
#' theme_rfar_conceptual()
524
theme_rfar_conceptual <- function(){
625
ggplot2::theme_bw() +
726
ggplot2::theme(legend.position = "none",

docs/reference/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
51.6 KB
Loading

docs/reference/theme_rfar_conceptual.html

Lines changed: 44 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/jmd_hydro_may1955.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/jmd_hydro_pmf.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/jmd_hydro_sdf.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/theme_rfar_conceptual.Rd

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)