ggfy: Plots a VAR

Description Usage Arguments Value Examples

Description

Plots a VAR

Usage

1
ggfy(x, single_plot = TRUE, plot = TRUE)

Arguments

x

an IRF-result as returned from irf

single_plot

if all facets should be plotted in a single graph, if FALSE, a list of plots for each from-variable is returned

plot

if FALSE only the plotting data is returned instead of actual plots

Value

a data_frame if plot == FALSE, a single ggplot if plot == TRUE, single_plot == TRUE or a list of ggplots if plot == TRUE, single_plot == FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(vars)
data(Canada)

varres <- VAR(Canada, p = 2, type = "none")
# plot the VAR result
ggfy(varres)

# to extract the data only
ggfy(varres, plot = FALSE)

# to get a list of plots
plot_list <- ggfy(varres, single_plot = FALSE)

# IRF
irfres <- irf(varres)
ggfy(irfres)

# to extract the data only
ggfy(irfres, plot = FALSE)

# to get a list of plots
plot_list <- ggfy(irfres, single_plot = FALSE)

DavZim/varsExtra documentation built on June 18, 2019, 7:45 p.m.