diff --git a/DESCRIPTION b/DESCRIPTION index a9eeb05..ad5be30 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,5 +39,5 @@ VignetteBuilder: knitr Depends: R (>= 3.5) LazyData: true -URL: https://github.com/ACCIDDA/accidasuite, https://ACCIDDA.github.io/accidasuite/, https://accidda.github.io/acciddasuite/ +URL: https://github.com/ACCIDDA/acciddasuite, https://ACCIDDA.github.io/acciddasuite/, https://accidda.github.io/acciddasuite/ Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index d1fa104..91ed938 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,7 +4,7 @@ S3method(fitted,model_epiestim) S3method(forecast,model_epiestim) S3method(glance,model_epiestim) S3method(model_sum,model_epiestim) -S3method(print,accida_cast) +S3method(print,accidda_cast) S3method(report,model_epiestim) S3method(residuals,model_epiestim) S3method(tidy,model_epiestim) diff --git a/R/get_fcast.R b/R/get_fcast.R index 3c7ed2d..5c52d53 100644 --- a/R/get_fcast.R +++ b/R/get_fcast.R @@ -30,7 +30,7 @@ #' #' The name of each list element is used as the model label in the output. #' -#' @return An object of class `accida_cast` containing: +#' @return An object of class `accidda_cast` containing: #' \describe{ #' \item{forecast}{Final `h` week ahead forecasts for all models and the ensemble.} #' \item{score}{Model ranking based on rolling origin WIS.} @@ -243,6 +243,6 @@ get_fcast <- function( score = score, plot = plot ) - class(acast) <- "accida_cast" + class(acast) <- "accidda_cast" return(acast) } diff --git a/R/print.R b/R/print.R index b7e680c..7e0906f 100644 --- a/R/print.R +++ b/R/print.R @@ -1,13 +1,13 @@ -#' Print an accida_cast object +#' Print an accidda_cast object #' -#' Displays a concise summary of an \code{accida_cast} object, +#' Displays a concise summary of an \code{accidda_cast} object, #' including model scores, forecast horizon, and hub format contents. #' -#' @param x An object of class \code{accida_cast}. +#' @param x An object of class \code{accidda_cast}. #' @param ... Additional arguments (currently ignored). #' @export -print.accida_cast <- function(x, ...) { - cat("\n\n") +print.accidda_cast <- function(x, ...) { + cat("\n\n") cat("Models evaluated:\n") print(x$score |> dplyr::select(model_id, wis), row.names = FALSE) diff --git a/R/to_respilens.R b/R/to_respilens.R index c98f7c9..f3f749b 100644 --- a/R/to_respilens.R +++ b/R/to_respilens.R @@ -115,21 +115,21 @@ forecasts_key <- function(model_out_tbl) { } -#' Convert accida_cast to RespiLens format -#' @param accida_cast An object of class `accida_cast`, the output of `get_fcast()`. +#' Convert accidda_cast to RespiLens format +#' @param accidda_cast An object of class `accidda_cast`, the output of `get_fcast()`. #' @param path Optional file path to write the JSON output to. Must end with `.json`. #' If `NULL`, the output is not written to disk. #' @return A named list with a single metadata JSON structure and one JSON structure per location. #' @export -to_respilens <- function(accida_cast, path = NULL) { - #check it is of class `accida_cast` - if (!inherits(accida_cast, "accida_cast")) { - stop("Input must be an object of class 'accida_cast'.") +to_respilens <- function(accidda_cast, path = NULL) { + #check it is of class `accidda_cast` + if (!inherits(accidda_cast, "accidda_cast")) { + stop("Input must be an object of class 'accidda_cast'.") } - model_out_tbl = accida_cast$hubcast$model_out_tbl - oracle_output = accida_cast$hubcast$oracle_output + model_out_tbl = accidda_cast$hubcast$model_out_tbl + oracle_output = accidda_cast$hubcast$oracle_output # Necessary model_out_tbl filtering # PATCH: removing 'peaks' keys for now (MyRespiLens doesn't support yet) diff --git a/README.md b/README.md index c5db557..be2bb77 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ df <- get_data(pathogen = "flu", geo_values = "ny") fcast <- df |> get_fcast(eval_start_date = max(df$target_end_date) - 30) fcast -#> +#> #> #> Models evaluated: #> model_id wis diff --git a/_pkgdown.yml b/_pkgdown.yml index 2468d53..0c88541 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -8,7 +8,7 @@ template: height: 250px repo: url: - home: https://github.com/ACCIDDA/accidasuite - issue: https://github.com/ACCIDDA/accidasuite/issues + home: https://github.com/ACCIDDA/acciddasuite + issue: https://github.com/ACCIDDA/acciddasuite/issues user: https://github.com/ACCIDDA - source: https://github.com/ACCIDDA/accidasuite/blob/main/ + source: https://github.com/ACCIDDA/acciddasuite/blob/main/ diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index 8b13789..0000000 --- a/docs/.nojekyll +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/404.html b/docs/404.html index 1b55edb..819071a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -49,7 +49,7 @@ - + diff --git a/docs/articles/acciddasuite.html b/docs/articles/acciddasuite.html index d77e9fd..78955e6 100644 --- a/docs/articles/acciddasuite.html +++ b/docs/articles/acciddasuite.html @@ -48,7 +48,7 @@ - + @@ -64,7 +64,7 @@

acciddasuite

- Source: vignettes/acciddasuite.Rmd + Source: vignettes/acciddasuite.Rmd
acciddasuite.Rmd
@@ -100,18 +100,18 @@

library(dplyr) library(ggplot2) library(pipetime) -library(acciddasuite) +library(acciddasuite) df <- get_data(pathogen = "covid", geo_values = "ny") head(df) #> # A tibble: 6 × 5 #> as_of location target target_end_date observation #> <date> <chr> <chr> <date> <dbl> -#> 1 2026-03-01 NY wk inc covid hosp 2020-08-08 517 -#> 2 2026-03-01 NY wk inc covid hosp 2020-08-15 490 -#> 3 2026-03-01 NY wk inc covid hosp 2020-08-22 844 -#> 4 2026-03-01 NY wk inc covid hosp 2020-08-29 483 -#> 5 2026-03-01 NY wk inc covid hosp 2020-09-05 479 -#> 6 2026-03-01 NY wk inc covid hosp 2020-09-12 573 +#> 1 2026-03-08 NY wk inc covid hosp 2020-08-08 517 +#> 2 2026-03-08 NY wk inc covid hosp 2020-08-15 490 +#> 3 2026-03-08 NY wk inc covid hosp 2020-08-22 844 +#> 4 2026-03-08 NY wk inc covid hosp 2020-08-29 483 +#> 5 2026-03-08 NY wk inc covid hosp 2020-09-05 479 +#> 6 2026-03-08 NY wk inc covid hosp 2020-09-12 573

To look at what df looks like, you can access the example csv file here: example_data.csv.

@@ -146,20 +146,20 @@

Time Series Cross-Validationtime_pipe("base fcast", log = "timing") fcast -#> <accida_cast> +#> <accidda_cast> #> #> Models evaluated: #> model_id wis #> <char> <num> -#> THETA 27.20068 -#> ARIMA 35.22355 -#> ETS 41.93945 -#> ENSEMBLE 53.91791 -#> SNAIVE 262.42959 +#> THETA 26.88197 +#> ARIMA 29.14217 +#> ETS 31.33395 +#> ENSEMBLE 52.64632 +#> SNAIVE 256.25401 #> #> Forecast horizon: -#> From: 2026-01-31 -#> To: 2026-03-28 +#> From: 2026-02-07 +#> To: 2026-04-04 #> #> Contents: #> $hubcast hub forecast object @@ -200,9 +200,9 @@

Adding extra_models
 get_log()
 #> $timing
-#>             timestamp       label  duration unit
-#> 1 2026-03-10 15:10:11  base fcast  3.002838 secs
-#> 2 2026-03-10 15:10:14 extra fcast 18.625748 secs
+#> timestamp label duration unit +#> 1 2026-03-18 14:24:26 base fcast 2.417592 secs +#> 2 2026-03-18 14:24:29 extra fcast 2.867576 secs
diff --git a/docs/articles/acciddasuite.md b/docs/articles/acciddasuite.md index 88c7030..ecc3367 100644 --- a/docs/articles/acciddasuite.md +++ b/docs/articles/acciddasuite.md @@ -37,12 +37,12 @@ head(df) #> # A tibble: 6 × 5 #> as_of location target target_end_date observation #> -#> 1 2026-03-01 NY wk inc covid hosp 2020-08-08 517 -#> 2 2026-03-01 NY wk inc covid hosp 2020-08-15 490 -#> 3 2026-03-01 NY wk inc covid hosp 2020-08-22 844 -#> 4 2026-03-01 NY wk inc covid hosp 2020-08-29 483 -#> 5 2026-03-01 NY wk inc covid hosp 2020-09-05 479 -#> 6 2026-03-01 NY wk inc covid hosp 2020-09-12 573 +#> 1 2026-03-08 NY wk inc covid hosp 2020-08-08 517 +#> 2 2026-03-08 NY wk inc covid hosp 2020-08-15 490 +#> 3 2026-03-08 NY wk inc covid hosp 2020-08-22 844 +#> 4 2026-03-08 NY wk inc covid hosp 2020-08-29 483 +#> 5 2026-03-08 NY wk inc covid hosp 2020-09-05 479 +#> 6 2026-03-08 NY wk inc covid hosp 2020-09-12 573 ``` To look at what `df` looks like, you can access the example `csv` file @@ -81,20 +81,20 @@ fcast = get_fcast( time_pipe("base fcast", log = "timing") fcast -#> +#> #> #> Models evaluated: #> model_id wis #> -#> THETA 27.20068 -#> ARIMA 35.22355 -#> ETS 41.93945 -#> ENSEMBLE 53.91791 -#> SNAIVE 262.42959 +#> THETA 26.88197 +#> ARIMA 29.14217 +#> ETS 31.33395 +#> ENSEMBLE 52.64632 +#> SNAIVE 256.25401 #> #> Forecast horizon: -#> From: 2026-01-31 -#> To: 2026-03-28 +#> From: 2026-02-07 +#> To: 2026-04-04 #> #> Contents: #> $hubcast hub forecast object @@ -145,9 +145,9 @@ You can check how long each step took by calling ``` r get_log() #> $timing -#> timestamp label duration unit -#> 1 2026-03-10 15:10:11 base fcast 3.002838 secs -#> 2 2026-03-10 15:10:14 extra fcast 18.625748 secs +#> timestamp label duration unit +#> 1 2026-03-18 14:24:26 base fcast 2.417592 secs +#> 2 2026-03-18 14:24:29 extra fcast 2.867576 secs ``` ## Submit to MyRespiLens diff --git a/docs/articles/acciddasuite_files/figure-html/models-1.png b/docs/articles/acciddasuite_files/figure-html/models-1.png index d791214..3f1ee02 100644 Binary files a/docs/articles/acciddasuite_files/figure-html/models-1.png and b/docs/articles/acciddasuite_files/figure-html/models-1.png differ diff --git a/docs/articles/acciddasuite_files/figure-html/tscv-setup-1.png b/docs/articles/acciddasuite_files/figure-html/tscv-setup-1.png deleted file mode 100644 index 05770a3..0000000 Binary files a/docs/articles/acciddasuite_files/figure-html/tscv-setup-1.png and /dev/null differ diff --git a/docs/articles/index.html b/docs/articles/index.html index aca61ec..e3bdd25 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -24,7 +24,7 @@
diff --git a/docs/authors.html b/docs/authors.html index 78e9c02..a20db08 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -24,7 +24,7 @@ @@ -46,18 +46,18 @@

Authors

Citation

-

Source: DESCRIPTION

+

Source: DESCRIPTION

Last F (2026). acciddasuite: A suite of tools for epidemic forecasting. -R package version 0.0.0.9000, https://github.com/ACCIDDA/accidasuite. +R package version 0.0.0.9000, https://github.com/ACCIDDA/acciddasuite.

@Manual{,
   title = {acciddasuite: A suite of tools for epidemic forecasting},
   author = {First Last},
   year = {2026},
   note = {R package version 0.0.0.9000},
-  url = {https://github.com/ACCIDDA/accidasuite},
+  url = {https://github.com/ACCIDDA/acciddasuite},
 }
diff --git a/docs/authors.md b/docs/authors.md index 03f9009..9f697d6 100644 --- a/docs/authors.md +++ b/docs/authors.md @@ -7,16 +7,16 @@ ## Citation Source: -[`DESCRIPTION`](https://github.com/ACCIDDA/accidasuite/blob/main/DESCRIPTION) +[`DESCRIPTION`](https://github.com/ACCIDDA/acciddasuite/blob/main/DESCRIPTION) Last F (2026). *acciddasuite: A suite of tools for epidemic forecasting*. R package version 0.0.0.9000, -. +. @Manual{, title = {acciddasuite: A suite of tools for epidemic forecasting}, author = {First Last}, year = {2026}, note = {R package version 0.0.0.9000}, - url = {https://github.com/ACCIDDA/accidasuite}, + url = {https://github.com/ACCIDDA/acciddasuite}, } diff --git a/docs/index.html b/docs/index.html index f61604a..a50c296 100644 --- a/docs/index.html +++ b/docs/index.html @@ -51,7 +51,7 @@ - + @@ -80,12 +80,12 @@

InstallationExample

-library(acciddasuite)
+library(acciddasuite)
 df <- get_data(pathogen = "flu", geo_values = "ny")
 fcast <- df |> 
   get_fcast(eval_start_date = max(df$target_end_date) - 30)
 fcast
-#> <accida_cast>
+#> <accidda_cast>
 #> 
 #> Models evaluated:
 #>  model_id        wis
@@ -115,7 +115,7 @@ 

Example

@@ -35,7 +35,7 @@
@@ -78,20 +78,24 @@

See also

Examples

get_data(pathogen = "covid", geo_values = c("ca", "ny"))
-#> # A tibble: 582 × 5
+#> Warning: No API key found. You will be limited to non-complex queries and encounter rate
+#> limits if you proceed.
+#>  See `?save_api_key()` for details on obtaining and setting API keys.
+#> This warning is displayed once every 8 hours.
+#> # A tibble: 584 × 5
 #>    as_of      location target            target_end_date observation
 #>    <date>     <chr>    <chr>             <date>                <dbl>
-#>  1 2026-03-01 CA       wk inc covid hosp 2020-08-08             4836
-#>  2 2026-03-01 NY       wk inc covid hosp 2020-08-08              517
-#>  3 2026-03-01 CA       wk inc covid hosp 2020-08-15             4273
-#>  4 2026-03-01 NY       wk inc covid hosp 2020-08-15              490
-#>  5 2026-03-01 CA       wk inc covid hosp 2020-08-22             3498
-#>  6 2026-03-01 NY       wk inc covid hosp 2020-08-22              844
-#>  7 2026-03-01 CA       wk inc covid hosp 2020-08-29             3100
-#>  8 2026-03-01 NY       wk inc covid hosp 2020-08-29              483
-#>  9 2026-03-01 CA       wk inc covid hosp 2020-09-05             2888
-#> 10 2026-03-01 NY       wk inc covid hosp 2020-09-05              479
-#> # ℹ 572 more rows
+#>  1 2026-03-08 CA       wk inc covid hosp 2020-08-08             4836
+#>  2 2026-03-08 NY       wk inc covid hosp 2020-08-08              517
+#>  3 2026-03-08 CA       wk inc covid hosp 2020-08-15             4273
+#>  4 2026-03-08 NY       wk inc covid hosp 2020-08-15              490
+#>  5 2026-03-08 CA       wk inc covid hosp 2020-08-22             3498
+#>  6 2026-03-08 NY       wk inc covid hosp 2020-08-22              844
+#>  7 2026-03-08 CA       wk inc covid hosp 2020-08-29             3100
+#>  8 2026-03-08 NY       wk inc covid hosp 2020-08-29              483
+#>  9 2026-03-08 CA       wk inc covid hosp 2020-09-05             2888
+#> 10 2026-03-08 NY       wk inc covid hosp 2020-09-05              479
+#> # ℹ 574 more rows