Hello Stack community,
For my project, I am visualizing impulse response function plots in R. I am trying to store each plot as an object in R (see PART1 of the code) in order to later append all of them in one plot (using cowplot library), as a facet chart (see PART 2 of the code). However, ultimate result of the code is an empty chart with only titles at the top.
I believe reason for empty plot should be that R stores my plots as empty objects
I would greatly appreciate your help.
R code below:
#PART 1: Making IRF plots and storing them as objects
plot.1 <- plot(irf(df, impulse = "abc", response = "abc", n.ahead = 8, ortho = TRUE, runs = 1000, seed = 1))
plot.2 <- plot(irf(df, impulse = "abc", response = "def", n.ahead = 8, ortho = TRUE, runs = 1000, seed = 1))
plot.3 <- plot(irf(df, impulse = "abc", response = "ghi", n.ahead = 8, ortho = TRUE, runs = 1000, seed = 1))
plot.4 <- plot(irf(df, impulse = "abc", response = "jkl", n.ahead = 8, ortho = TRUE, runs = 1000, seed = 1))
#PART 2: making facet
library(cowplot)
plot_grid(plot.1, plot.2, plot.3, plot.4, rremove("x.text"),
labels = c("A", "B", "C", "D"),
ncol = 2, nrow = 2)