Running examples in 'opera-Ex.R' failed
The error most likely occurred in:

> ### Name: mixture
> ### Title: Compute an aggregation rule
> ### Aliases: mixture print.mixture summary.mixture
> ### Keywords: ~models ~ts
> 
> ### ** Examples
> 
> #' 
> library('opera')  # load the package
> set.seed(1)
> 
> # Example: find the best one week ahead forecasting strategy (weekly data)
> # packages
> library(mgcv)
Loading required package: nlme
This is mgcv 1.8-35. For overview type 'help("mgcv-package")'.
> 
> # import data
> data(electric_load)
> idx_data_test <- 620:nrow(electric_load)
> data_train <- electric_load[-idx_data_test, ]
> data_test <- electric_load[idx_data_test, ]
> 
> # Build the expert forecasts 
> # ##########################
> 
> # 1) A generalized additive model
> gam.fit <- gam(Load ~ s(IPI) + s(Temp) + s(Time, k=3) + 
+                 s(Load1) + as.factor(NumWeek), data = data_train)
> gam.forecast <- predict(gam.fit, newdata = data_test)
> 
> # 2) An online autoregressive model on the residuals of a medium term model
> 
> # Medium term model to remove trend and seasonality (using generalized additive model)
> detrend.fit <- gam(Load ~ s(Time,k=3) + s(NumWeek) + s(Temp) + s(IPI), data = data_train)
> electric_load$Trend <- c(predict(detrend.fit), predict(detrend.fit,newdata = data_test))
> electric_load$Load.detrend <- electric_load$Load - electric_load$Trend
> 
> # Residual analysis
> ar.forecast <- numeric(length(idx_data_test))
> for (i in seq(idx_data_test)) {
+  ar.fit <- ar(electric_load$Load.detrend[1:(idx_data_test[i] - 1)])
+  ar.forecast[i] <- as.numeric(predict(ar.fit)$pred) + electric_load$Trend[idx_data_test[i]]
+ }
> 
> # Aggregation of experts
> ###########################
> 
> X <- cbind(gam.forecast, ar.forecast)
> colnames(X) <- c('gam', 'ar')
> Y <- data_test$Load
> 
> matplot(cbind(Y, X), type = 'l', col = 1:6, ylab = 'Weekly load', xlab = 'Week')
> 
> 
> # How good are the expert? Look at the oracles
> oracle.convex <- oracle(Y = Y, experts = X, loss.type = 'square', model = 'convex')
Warning in doTryCatch(return(expr), name, parentenv, handler) :
  The quadprog package must be installed to use this functionality
> plot(oracle.convex)
[1] "The RColorBrewer package must be installed to get better colors\n"
> oracle.convex
Call:
oracle.default(Y = Y, experts = X, model = "convex", loss.type = "square")

Coefficients:
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x),  : 
  'data' must be of a vector type, was 'NULL'
Calls: <Anonymous> ... data.frame -> matrix -> as.matrix -> as.matrix.default -> array
Execution halted