From e1b876ab250b1fbf2684318c50e81ad45f2c09a6 Mon Sep 17 00:00:00 2001 From: Nikolas Kuschnig Date: Thu, 2 May 2019 11:46:29 +0200 Subject: [PATCH] Fix to examples for fcast and irf plot --- R/85_plot_fcast.R | 10 +++++----- R/86_plot_irf.R | 10 +++++----- man/plot.bvar_fcast.Rd | 6 +----- man/plot.bvar_irf.Rd | 6 +----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/R/85_plot_fcast.R b/R/85_plot_fcast.R index c35fb0e..1ac6277 100644 --- a/R/85_plot_fcast.R +++ b/R/85_plot_fcast.R @@ -21,7 +21,7 @@ #' #' @examples #' \donttest{ -#' data <- matrix(rnorm(200), ncol = 2) +#' data <- matrix(rnorm(400), ncol = 4) #' x <- bvar(data, lags = 2) #' #' # Plot forecasts for all available variables @@ -29,10 +29,10 @@ #' #' # Subset to variables in positions 1, 2 and 4 via position and name #' bv_plot_fcast(x, vars = c(1, 2, 4)) -#' bv_plot_fcast(x, -#' variables = c("gdp", "flux", "cpi", "capacitor"), -#' vars = c("gdp", "flux", "capacitor") -#' ) +# bv_plot_fcast(x, +# variables = c("gdp", "flux", "cpi", "capacitor"), +# vars = c("gdp", "flux", "capacitor") +# ) #' #' # Use the method to plot, adjust confidence bands and orientation #' plot(x$fcast, conf_bands = c(0.01, 0.05), orientation = "h") diff --git a/R/86_plot_irf.R b/R/86_plot_irf.R index fa7abae..58faab5 100644 --- a/R/86_plot_irf.R +++ b/R/86_plot_irf.R @@ -23,7 +23,7 @@ #' #' @examples #' \donttest{ -#' data <- matrix(rnorm(200), ncol = 2) +#' data <- matrix(rnorm(400), ncol = 4) #' x <- bvar(data, lags = 2) #' #' # Plot impulse responses for all available variables @@ -31,10 +31,10 @@ #' #' # Subset to impulse variables in positions 2 and 4 via position and name #' bv_plot_irf(x, vars_impulse = c(2, 4)) -#' bv_plot_irf(x, -#' variables = c("solved", "for", "many", "decades"), -#' vars_impulse = c("for", "decades") -#' ) +# bv_plot_irf(x, +# variables = c("solved", "for", "many", "decades"), +# vars_impulse = c("for", "decades") +# ) #' #' # Use the method to plot and adjust confidence bands #' plot(x$irf, conf_bands = c(0.01, 0.05)) diff --git a/man/plot.bvar_fcast.Rd b/man/plot.bvar_fcast.Rd index 9cef3bd..59ec320 100644 --- a/man/plot.bvar_fcast.Rd +++ b/man/plot.bvar_fcast.Rd @@ -40,7 +40,7 @@ of all or a subset of the available variables can be plotted. } \examples{ \donttest{ -data <- matrix(rnorm(200), ncol = 2) +data <- matrix(rnorm(400), ncol = 4) x <- bvar(data, lags = 2) # Plot forecasts for all available variables @@ -48,10 +48,6 @@ bv_plot_fcast(x) # Subset to variables in positions 1, 2 and 4 via position and name bv_plot_fcast(x, vars = c(1, 2, 4)) -bv_plot_fcast(x, - variables = c("gdp", "flux", "cpi", "capacitor"), - vars = c("gdp", "flux", "capacitor") -) # Use the method to plot, adjust confidence bands and orientation plot(x$fcast, conf_bands = c(0.01, 0.05), orientation = "h") diff --git a/man/plot.bvar_irf.Rd b/man/plot.bvar_irf.Rd index 0d9913c..2b2d3af 100644 --- a/man/plot.bvar_irf.Rd +++ b/man/plot.bvar_irf.Rd @@ -42,7 +42,7 @@ plotted. } \examples{ \donttest{ -data <- matrix(rnorm(200), ncol = 2) +data <- matrix(rnorm(400), ncol = 4) x <- bvar(data, lags = 2) # Plot impulse responses for all available variables @@ -50,10 +50,6 @@ bv_plot_irf(x) # Subset to impulse variables in positions 2 and 4 via position and name bv_plot_irf(x, vars_impulse = c(2, 4)) -bv_plot_irf(x, - variables = c("solved", "for", "many", "decades"), - vars_impulse = c("for", "decades") -) # Use the method to plot and adjust confidence bands plot(x$irf, conf_bands = c(0.01, 0.05))