-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Lines 148 to 187 in 70e55ac
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| library(tsibbledata) | |
| aus_production \%>\% | |
| autoplot(vars(Beer, Cement)) | |
| fit <- aus_production \%>\% | |
| model(VARIMA(vars(Beer, Cement) ~ pdq(4,1,1), identification = "none")) | |
| fit | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| fit \%>\% | |
| forecast(h = 50) \%>\% | |
| autoplot(tail(aus_production, 100)) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| fitted(fit) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| residuals(fit) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| tidy(fit) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| glance(fit) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| report(fit) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| generate(fit, h = 10) | |
| \dontshow{\}) # examplesIf} | |
| \dontshow{if (requireNamespace("tsibbledata", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} | |
| IRF(fit, h = 10, impulse = "Beer") | |
| \dontshow{\}) # examplesIf} | |
| } |
IINM this is due to stitching together @examples from various different sources.
I'm not sure the best approach here -- one idea is to just have all the examples in one place:
Lines 171 to 182 in 70e55ac
| #' @examplesIf requireNamespace("tsibbledata", quietly = TRUE) | |
| #' library(tsibbledata) | |
| #' | |
| #' aus_production %>% | |
| #' autoplot(vars(Beer, Cement)) | |
| #' | |
| #' fit <- aus_production %>% | |
| #' model(VARIMA(vars(Beer, Cement) ~ pdq(4,1,1), identification = "none")) | |
| #' | |
| #' fit | |
| #' @export | |
| VARIMA <- function(formula, identification = NULL, ...) { |
But I understand the appeal of having the example live near the function it's for, e.g.
Lines 198 to 205 in 70e55ac
| #' @rdname VARIMA | |
| #' @inheritParams forecast.VAR | |
| #' @examplesIf requireNamespace("tsibbledata", quietly = TRUE) | |
| #' | |
| #' fit %>% | |
| #' forecast(h = 50) %>% | |
| #' autoplot(tail(aus_production, 100)) | |
| #' @export |
OTOH, part of the idea of {roxygen2} is to just never look at Rd files again, so maybe I'm just silly for doing so :)
Metadata
Metadata
Assignees
Labels
No labels