Running examples in ‘dynsim-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: dynsimGG
> ### Title: Plot dynamic simulation results from 'dynsim'
> ### Aliases: dynsimGG
> 
> ### ** Examples
> 
> # Load package
> library(DataCombine)
> 
> # Load Grunfeld data
> data(grunfeld, package = "dynsim")
> 
> # Create lag invest variable
> grunfeld <- slide(grunfeld, Var = "invest", GroupVar = "company",
+                NewVar = "InvestLag")

Remember to order grunfeld by company and the time variable before running.

Lagging invest by 1 time units.

> 
> # Convert company to factor for fixed-effects specification
> grunfeld$company <- as.factor(grunfeld$company)
> # Estimate basic model
> M1 <- lm(invest ~ InvestLag + mvalue + kstock + company, data = grunfeld)
> 
> # Set up scenarios for company 4
> attach(grunfeld)
> Scen1 <- data.frame(InvestLag = mean(InvestLag, na.rm = TRUE),
+                     mvalue = quantile(mvalue, 0.05),
+                     kstock = quantile(kstock, 0.05),
+                     company4 = 1)
> Scen2 <- data.frame(InvestLag = mean(InvestLag, na.rm = TRUE),
+                     mvalue = mean(mvalue),
+                     kstock = mean(kstock),
+                     company4 = 1)
> Scen3 <- data.frame(InvestLag = mean(InvestLag, na.rm = TRUE),
+                     mvalue = quantile(mvalue, 0.95),
+                     kstock = quantile(kstock, 0.95),
+                     company4 = 1)
> detach(grunfeld)
> 
> # Combine into a single list
> ScenComb <- list(Scen1, Scen2, Scen3)
> 
> ## Run dynamic simulations without shocks
> Sim1 <- dynsim(obj = M1, ldv = "InvestLag", scen = ScenComb, n = 20)
> 
> # Create plot legend label
> Labels <- c("5th Percentile", "Mean", "95th Percentile")
> 
> # Plot
> dynsimGG(Sim1, leg.labels = Labels)
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... push.vp.vpTree -> push.vp -> push.vp.viewport -> grid.Call.graphics
Execution halted