Skip to content

Commit

Permalink
add col argument to show_prdseries
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jan 25, 2024
1 parent 59ed055 commit 2876cdd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: wqtrends
Title: Assess Water Quality Trends with Generalized Additive Models
Version: 1.4.1
Date: 2023-11-22
Date: 2024-01-25
Authors@R: c(
person(given = "Marcus",
family = "Beck",
Expand Down
5 changes: 3 additions & 2 deletions R/show_prdseries.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param base_size numeric indicating base font size, passed to \code{\link[ggplot2]{theme_bw}}
#' @param xlim optional numeric vector of length two for x-axis limits
#' @param ylim optional numeric vector of length two for y-axis limits
#' @param col optional chr string for line color
#'
#' @return A \code{\link[ggplot2]{ggplot}} object
#' @export
Expand All @@ -25,7 +26,7 @@
#' mod <- anlz_gam(tomod, trans = 'log10')
#'
#' show_prdseries(mod, ylab = 'Chlorophyll-a (ug/L)')
show_prdseries <- function(mod, ylab, alpha = 0.7, base_size = 11, xlim = NULL, ylim = NULL){
show_prdseries <- function(mod, ylab, alpha = 0.7, base_size = 11, xlim = NULL, ylim = NULL, col = 'brown'){

# get predictions
prds <- anlz_prd(mod)
Expand All @@ -47,7 +48,7 @@ show_prdseries <- function(mod, ylab, alpha = 0.7, base_size = 11, xlim = NULL,

p <- ggplot2::ggplot(prds, ggplot2::aes(x = date)) +
ggplot2::geom_point(data = moddat, ggplot2::aes(y = value), size = 0.5) +
ggplot2::geom_line(ggplot2::aes(y = value), size = 0.75, alpha = alpha, colour = 'brown') +
ggplot2::geom_line(ggplot2::aes(y = value), size = 0.75, alpha = alpha, colour = col) +
# ggplot2::geom_line(ggplot2::aes(y = annvalue), alpha = alpha, colour = 'tomato1') +
ggplot2::theme_bw(base_size = base_size) +
ggplot2::theme(
Expand Down
5 changes: 4 additions & 1 deletion man/show_prdseries.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2876cdd

Please sign in to comment.