Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SofiaOtero committed Nov 5, 2024
1 parent 56c940b commit 9b0f900
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 50 deletions.
8 changes: 4 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by roxygen2: do not edit by hand

S3method(autoplot,aedseo)
S3method(autoplot,aedseo_tsd)
S3method(plot,aedseo)
S3method(plot,aedseo_tsd)
S3method(autoplot,seasonal_onset)
S3method(autoplot,tsd)
S3method(plot,seasonal_onset)
S3method(plot,tsd)
S3method(predict,seasonal_onset)
S3method(summary,seasonal_onset)
export("%>%")
Expand Down
31 changes: 15 additions & 16 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
#'
#' @description
#'
#' This function generates a complete 'ggplot' object suitable for
#' visualizing time series data in an `aedseo_tsd` object. It creates a line
#' plot connecting the observations and adds points at each data point.
#' This function generates a complete 'ggplot' object suitable for visualizing time series data in an `tsd` object.
#' It creates a line plot connecting the observations and adds points at each data point.
#'
#' @param x An `aedseo_tsd` or `aedseo` object
#' @param x An `tsd` or `seasonal_onset` object
#' @param ... Additional arguments passed to specific methods.
#'
#' @return A 'ggplot' object for visualizing the time series data.
Expand All @@ -16,8 +15,8 @@
#' @seealso [autoplot()]
#'
#' @examples
#' # Create an example aedseo_tsd object
#' aedseo_tsd_object <- tsd(
#' # Create an example tsd object
#' tsd_object <- tsd(
#' observation = c(100, 120, 150, 180, 220, 270),
#' time = as.Date(c(
#' "2023-01-01",
Expand All @@ -30,29 +29,29 @@
#' time_interval = "day"
#' )
#'
#' # Create a ggplot visualization for the aedseo_tsd object
#' plot(aedseo_tsd_object)
#' # Create a ggplot visualization for the tsd object
#' plot(tsd_object)
#'
#' # Create an aedseo object
#' aedseo_object <- aedseo(
#' tsd = aedseo_tsd_object,
#' # Create an seasonal_onset object
#' object <- seasonal_onset(
#' tsd = tsd_object,
#' k = 3,
#' level = 0.95,
#' family = "quasipoisson"
#' )
#'
#' # Create a ggplot visualization of growth rates with confidence intervals
#' plot(aedseo_object, linewidth = 1, alpha = 0.2)
#' plot(object, linewidth = 1, alpha = 0.2)
#' @importFrom graphics plot
#' @rdname plot
#' @method plot aedseo_tsd
#' @method plot tsd
#' @export
plot.aedseo_tsd <- function(x, ...) {
plot.tsd <- function(x, ...) {
print(autoplot(x, ...))
}
#' @rdname plot
#' @method plot aedseo
#' @method plot seasonal_onset
#' @export
plot.aedseo <- function(x, ...) {
plot.seasonal_onset <- function(x, ...) {
print(autoplot(object = x, ...))
}
26 changes: 13 additions & 13 deletions man/autoplot.Rd

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

33 changes: 16 additions & 17 deletions man/plot.Rd

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

0 comments on commit 9b0f900

Please sign in to comment.