Skip to content

Commit

Permalink
example plotting with ggplot2 handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dajmcdon committed Sep 25, 2023
1 parent c13b83e commit 16f6c2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/layer_cdc_flatline_quantiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#' pivot_quantiles(.pred_distn) %>%
#' mutate(target_date = forecast_date + ahead)
#'
#' library(ggplot2)
#' if (require("ggplot2")) {
#' four_states <- c("ca", "pa", "wa", "ny")
#' preds %>%
#' filter(geo_value %in% four_states) %>%
Expand All @@ -92,7 +92,7 @@
#' facet_wrap(~geo_value, scales = "free_y") +
#' theme_bw() +
#' geom_vline(xintercept = forecast_date)
#'
#' }
layer_cdc_flatline_quantiles <- function(
frosting,
...,
Expand Down
3 changes: 2 additions & 1 deletion R/make_smooth_quantile_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
#' lines(pl$x, pl$`0.2`, col = "blue")
#' lines(pl$x, pl$`0.8`, col = "blue")
#' lines(pl$x, pl$`0.5`, col = "red")
#' \dontrun{
#'
#' if (require("ggplot2")) {
#' ggplot(data.frame(x = x, y = y), aes(x)) +
#' geom_ribbon(data = pl, aes(ymin = `0.2`, ymax = `0.8`), fill = "lightblue") +
#' geom_point(aes(y = y), colour = "grey") + # observed data
Expand Down

0 comments on commit 16f6c2c

Please sign in to comment.