Skip to content

Commit

Permalink
doc: fix examples, vignettes, add waldo
Browse files Browse the repository at this point in the history
  • Loading branch information
dshemetov committed Sep 26, 2024
1 parent b3f772c commit e7028ef
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
^.lintr$
^DEVELOPMENT.md$
man-roxygen
^.venv$
^sandbox.R$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ docs
renv/
renv.lock
.Rprofile
sandbox.R
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Imports:
tidyselect (>= 1.2.0),
tsibble,
utils,
vctrs
vctrs,
waldo
Suggests:
covidcast,
devtools,
Expand Down
4 changes: 2 additions & 2 deletions R/methods-epi_archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ epix_detailed_restricted_mutate <- function(.data, ...) {
#' library(dplyr)
#'
#' # Reference time points for which we want to compute slide values:
#' versions <- seq(as.Date("2020-06-01"),
#' versions <- seq(as.Date("2020-06-02"),
#' as.Date("2020-06-15"),
#' by = "1 day"
#' )
Expand Down Expand Up @@ -780,7 +780,7 @@ epix_detailed_restricted_mutate <- function(.data, ...) {
#' .versions = versions
#' ) %>%
#' ungroup() %>%
#' arrange(geo_value, time_value)
#' arrange(geo_value, version)
#'
#' # --- Advanced: ---
#'
Expand Down
8 changes: 3 additions & 5 deletions R/outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ detect_outlr <- function(x = seq_along(y), y,
#' group_by(geo_value) %>%
#' mutate(outlier_info = detect_outlr_rm(
#' x = time_value, y = cases
#' )) %>%
#' unnest(outlier_info)
#' ))
detect_outlr_rm <- function(x = seq_along(y), y, n = 21,
log_transform = FALSE,
detect_negatives = FALSE,
Expand Down Expand Up @@ -256,9 +255,8 @@ detect_outlr_rm <- function(x = seq_along(y), y, n = 21,
#' group_by(geo_value) %>%
#' mutate(outlier_info = detect_outlr_stl(
#' x = time_value, y = cases,
#' seasonal_period = 7
#' )) %>% # weekly seasonality for daily data
#' unnest(outlier_info)
#' seasonal_period = 7 # weekly seasonality for daily data
#' ))
detect_outlr_stl <- function(x = seq_along(y), y,
n_trend = 21,
n_seasonal = 21,
Expand Down
2 changes: 1 addition & 1 deletion R/slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ epi_slide_opt <- function(
# positions of user-provided `col_names` into string column names. We avoid
# using `names(pos)` directly for robustness and in case we later want to
# allow users to rename fields via tidyselection.
if (class(quo_get_expr(enquo(.col_names))) == "character") {
if (inherits(quo_get_expr(enquo(.col_names)), "character")) {
pos <- eval_select(dplyr::all_of(.col_names), data = .x, allow_rename = FALSE)
} else {
pos <- eval_select(enquo(.col_names), data = .x, allow_rename = FALSE)
Expand Down
3 changes: 1 addition & 2 deletions man/detect_outlr_rm.Rd

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

5 changes: 2 additions & 3 deletions man/detect_outlr_stl.Rd

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

4 changes: 2 additions & 2 deletions man/epix_slide.Rd

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

2 changes: 1 addition & 1 deletion vignettes/archive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ format, with `issue` playing the role of `version`. We can now use
redundant version updates in `as_epi_archive` using compactify, please refer to
the [compactify vignette](articles/compactify.html).

```{r, eval=FALSE}
```{r}
x <- dv %>%
select(geo_value, time_value, version = issue, percent_cli = value) %>%
as_epi_archive(compactify = TRUE)
Expand Down

0 comments on commit e7028ef

Please sign in to comment.