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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: irace-package
> ### Title: The irace package: Iterated Racing for Automatic Algorithm
> ###   Configuration
> ### Aliases: irace-package
> ### Keywords: automatic configuration optimize package tuning
> 
> ### ** Examples
> 
>  #######################################################################
>  # This example illustrates how to tune the parameters of the simulated
>  # annealing algorithm (SANN) provided by the optim() function in the
>  # R base package.  The goal in this example is to optimize instances of
>  # the following family:
>  # f(x) = lambda * f_rastrigin(x) + (1 - lambda) * f_rosenbrock(x)
>  # where lambda follows a normal distribution whose mean is 0.9 and
>  # standard deviation is 0.02. f_rastrigin and f_rosenbrock are the
>  # well-known Rastrigin and Rosenbrock benchmark functions (taken from
>  # the cmaes package). In this scenario, different instances are given
>  # by different values of lambda.
>  #######################################################################
>  ## First we provide an implementation of the functions to be optimized:
>  f_rosenbrock <- function (x) {
+    d <- length(x)
+    z <- x + 1
+    hz <- z[1:(d - 1)]
+    tz <- z[2:d]
+    s <- sum(100 * (hz^2 - tz)^2 + (hz - 1)^2)
+    return(s)
+  }
>  f_rastrigin <- function (x) {
+    sum(x * x - 10 * cos(2 * pi * x) + 10)
+  }
>  
>  ## We generate 200 instances (in this case, weights):
>  weights <- rnorm(200, mean = 0.9, sd = 0.02)
>  
>  ## On this set of instances, we are interested in optimizing two
>  ## parameters of the SANN algorithm: tmax and temp. We setup the
>  ## parameter space as follows:
>  parameters.table <- '
+  tmax "" i (1, 5000)
+  temp "" r (0, 100)
+  '
>  
>  ## We use the irace function readParameters to read this table:
>  parameters <- readParameters(text = parameters.table)
>  
>  ## Next, we define the function that will evaluate each candidate
>  ## configuration on a single instance. For simplicity, we restrict to
>  ## three-dimensional functions and we set the maximum number of
>  ## iterations of SANN to 5000.
>  target.runner <- function(experiment, scenario)
+  {
+    instance <- experiment$instance
+    configuration <- experiment$configuration
+  
+    D <- 3
+    par <- runif(D, min=-1, max=1)
+    fn <- function(x) {
+      weight <- instance
+      return(weight * f_rastrigin(x) + (1 - weight) * f_rosenbrock(x))
+    }
+    res <- stats::optim(par,fn, method="SANN",
+                 control=list(maxit=5000
+                   , tmax = as.numeric(configuration[["tmax"]])
+                   , temp = as.numeric(configuration[["temp"]])
+                   ))
+    ## New output interface in irace 2.0. This list may also contain:
+    ## - 'time' if irace is called with 'maxTime'
+    ## - 'error' is a string used to report an error
+    ## - 'outputRaw' is a string used to report the raw output of calls to
+    ##   an external program or function.
+    ## - 'call' is a string used to report how target.runner called the
+    ##   external program or function.
+    return(list(cost = res$value))
+  }
>  
>  ## We define a configuration scenario by setting targetRunner to the
>  ## function define above, instances to the first 100 random weights, and
>  ## a maximum budget of 1000 calls to targetRunner.
>  scenario <- list(targetRunner = target.runner,
+                   instances = weights[1:100],
+                   maxExperiments = 1000,
+                   # Do not create a logFile
+                   logFile = "")
>  
>  ## We check that the scenario is valid. This will also try to execute
>  ## target.runner.
>  checkIraceScenario(scenario, parameters = parameters)
# 2020-03-07 21:28:21 CET: Checking scenario
## irace scenario:
scenarioFile = "./scenario.txt"
parameterFile = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/irace.Rcheck/parameters.txt"
execDir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/irace.Rcheck"
logFile = NULL
recoveryFile = NULL
instances = c(0.887470923785153, 0.903672866484442, 0.883287427751799, 0.931905616042756, 0.906590155436307, 0.88359063231764, 0.90974858104857, 0.914766494102584, 0.91151562703307, 0.893892232256873, 0.930235623369017, 0.907796864728229, 0.887575188389164, 0.85570600225645, 0.922498618362862, 0.899101327819695, 0.899676194738021, 0.918876724213706, 0.916424423901962, 0.91187802642435, 0.918379547432164, 0.915642726014621, 0.901491299667304, 0.860212966082733, 0.912396514957894, 0.89887742520942, 0.896884089865893, 0.870584952322014, 0.890436998897828, 0.908358831203994, 0.927173591030581, 0.89794424545314, 0.907753432231187, 0.898923899188342, 0.872458808863428, 0.891700108734006, 0.892114200925793, 0.898813732065776, 0.922000507439678, 0.915263514969151, 0.896709528074928, 0.89493276639727, 0.913939267508095, 0.911133263973473, 0.88622488610901, 0.885850096860758, 0.907291639242737, 0.915370658490308, 0.897753075756995, 0.917622154529084, 0.907962117607341, 0.887759472134985, 0.906822393828489, 0.877412738078384, 0.928660474034021, 0.939607997970117, 0.89265557047067, 0.879117307473669, 0.911394392548848, 0.897298907922384, 0.948032355210096, 0.899215199945337, 0.913794787249016, 0.900560043175613, 0.885134535822352, 0.903775845990287, 0.863900827422179, 0.929311097231258, 0.903065066764238, 0.943452233407243, 0.909510190577993, 0.885801071381564, 0.912214527069781, 0.881318047367115, 0.874927331995218, 0.905828924710349, 0.891134162535631, 0.900022107032633, 0.901486826483033, 0.888209581076239, 0.88862662534363, 0.897296427697523, 0.923561739931464, 0.869528663991405, 0.911878923752568, 0.90665900742427, 0.921261996745527, 0.893916321527314, 0.907400376198326, 0.905341975815445, 0.889149599380167, 0.924157356119663, 0.923208052313899, 0.9140042729903, 0.931736669090817, 0.911169728511306, 0.874468155830839, 0.888534691715262, 0.875507747702033, 0.890531987271214)
trainInstancesDir = "./Instances"
trainInstancesFile = ""
configurationsFile = ""
forbiddenExps = NULL
forbiddenFile = ""
targetRunner = function (experiment, scenario) {    instance <- experiment$instance    configuration <- experiment$configuration    D <- 3    par <- runif(D, min = -1, max = 1)    fn <- function(x) {        weight <- instance        return(weight * f_rastrigin(x) + (1 - weight) * f_rosenbrock(x))    }    res <- stats::optim(par, fn, method = "SANN", control = list(maxit = 5000,         tmax = as.numeric(configuration[["tmax"]]), temp = as.numeric(configuration[["temp"]])))    return(list(cost = res$value))}
targetRunnerRetries = 0
targetRunnerData = ""
targetRunnerParallel = NULL
targetEvaluator = NULL
maxExperiments = 1000
maxTime = 0
budgetEstimation = 0.02
digits = 4
debugLevel = 2
nbIterations = 0
nbExperimentsPerIteration = 0
sampleInstances = TRUE
testType = "friedman"
firstTest = 5
eachTest = 1
minNbSurvival = 0
nbConfigurations = 0
mu = 5
confidence = 0.95
deterministic = FALSE
seed = NA_character_
parallel = 0
loadBalancing = TRUE
mpi = FALSE
batchmode = "0"
softRestart = TRUE
softRestartThreshold = 1e-04
testInstancesDir = ""
testInstancesFile = ""
testInstances = NULL
testNbElites = 1
testIterationElites = FALSE
elitist = TRUE
elitistNewInstances = 1
elitistLimit = 2
repairConfiguration = NULL
capping = FALSE
cappingType = "median"
boundType = "candidate"
boundMax = NULL
boundDigits = 0
boundPar = 1
boundAsTimeout = TRUE
postselection = 0
aclib = FALSE
## end of irace scenario
# Parameters provided by user.
# Parameter file '/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/irace.Rcheck/parameters.txt' will be ignored
# 2020-03-07 21:28:21 CET: Checking target execution.
Error in .subset(x, j) : invalid subscript type 'list'
Calls: checkIraceScenario ... checkTargetFiles -> createExperimentList -> [ -> [.data.frame
Execution halted