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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: mixopt
> ### Title: Mixed variable optimization using coordinate descent
> ### Aliases: mixopt mixopt_blockcd mixopt_coorddesc mixopt_multistart
> 
> ### ** Examples
> 
> # Simple 1D example
> mixopt_blockcd(par=list(mopar_cts(2,8)), fn=function(x) {(4.5-x[1])^2})
$par
[1] 4.5

$val
[1] 0

$counts
function gradient 
      13        0 

$runtime
Time difference of 0.01017475 secs

> # With gradient (isn't faster)
> mixopt_blockcd(par=list(mopar_cts(2,8)), fn=function(x) {(4.5-x[1])^2},
+                gr=function(x) {-2*(4.5-x[1])})
$par
[1] 4.5

$val
[1] 0

$counts
function gradient 
       5        4 

$runtime
Time difference of 0.009095669 secs

> 
> # 1D discrete ordered
> mixopt_blockcd(par=list(mopar_ordered(100:10000)),
+                  fn=function(x) {(x[1] - 500.3)^2})
$par
[1] 500

$val
[1] 0.09

$counts
function gradient 
      42        0 

$runtime
Time difference of 0.008888245 secs

> 
> # 2D: one continuous, one factor
> mixopt_blockcd(par=list(mopar_cts(2,8), mopar_unordered(letters[1:6])),
+                  fn=function(x) {ifelse(x[2] == 'b', -1, 0) +
+                                  (4.5-x[1])^2})
$par
mixopt_list: [1] 4.5 b

$val
[1] -1

$counts
function gradient 
      26        0 

$runtime
Time difference of 0.01639581 secs

> # Simple 1D example
> mixopt_coorddesc(par=list(mopar_cts(2,8)), fn=function(x) {(4.5-x[1])^2})
$par
[1] 4.5

$val
[1] 0

$counts
function gradient 
      13        0 

$runtime
Time difference of 0.0004503727 secs

> 
> # 1D discrete ordered
> mixopt_coorddesc(par=list(mopar_ordered(100:10000)),
+                  fn=function(x) {(x[1] - 500.3)^2})
$par
[1] 500

$val
[1] 0.09

$counts
function gradient 
      42        0 

$runtime
Time difference of 0.001083136 secs

> 
> # 2D: one continuous, one factor
> mixopt_coorddesc(par=list(mopar_cts(2,8), mopar_unordered(letters[1:6])),
+                  fn=function(x) {ifelse(x[2] == 'b', -1, 0) +
+                                  (4.5-x[1])^2})
$par
mixopt_list: [1] 4.5 b

$val
[1] -1

$counts
function gradient 
      26        0 

$runtime
Time difference of 0.001773119 secs

> # 2D
> library(ggplot2)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> f6 <- function(x) {-(-x[1]*.5*sin(.5*x[1])*1 - 1e-2*x[2]^2 +
+                        .2*x[1] - .3*x[2])}
> ContourFunctions::cf_func(f6, xlim=c(0,100), ylim=c(-100,100))
Error in loadNamespace(x) : there is no package called ‘ContourFunctions’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted