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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: hamlet-package
> ### Title: Hierarchical Optimal Matching and Machine Learning Toolbox
> ### Aliases: hamlet-package hamlet
> ### Keywords: package
> 
> ### ** Examples
> 
> 
> ##
> ## Exploring the VCaP dataset provided alongside the 'hamlet' package
> ##
> 
> data(vcapwide)
> data(vcaplong)
> 
> # VCaP Castration-resistant prostate cancer (CRPC) PSA-measurements (and body weight) in wide-format
> mixplot(vcapwide[,c("PSAWeek10", "PSAWeek14", "BWWeek10", "Group")], pch=16)
> anv <- aov(PSA ~ Group, data.frame(PSA = vcapwide[,"PSAWeek14"], Group = vcapwide[,"Group"]))
> summary(anv)
            Df Sum Sq Mean Sq F value  Pr(>F)   
Group        2   7038    3519   6.286 0.00416 **
Residuals   41  22950     560                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
1 observation deleted due to missingness
> TukeyHSD(anv)
  Tukey multiple comparisons of means
    95% family-wise confidence level

Fit: aov(formula = PSA ~ Group, data = data.frame(PSA = vcapwide[, "PSAWeek14"], Group = vcapwide[, "Group"]))

$Group
                diff       lwr      upr     p adj
MDV-ARN     12.85805 -8.521008 34.23710 0.3192860
Vehicle-ARN 30.51267  9.505449 51.51988 0.0029165
Vehicle-MDV 17.65462 -3.724436 39.03367 0.1230428

> summary(aov(BW ~ Group, data.frame(BW = vcapwide[,"BWWeek14"], Group = vcapwide[,"Group"])))
            Df Sum Sq Mean Sq F value Pr(>F)
Group        2    4.5   2.236   0.289  0.751
Residuals   41  317.6   7.746               
1 observation deleted due to missingness
> 
> # VCaP Castration-resistant prostate cancer (CRPC) PSA-measurements (and body weight) in long-format
> library(lattice)
> xyplot(log2PSA ~ DrugWeek | Group, data = vcaplong, type="l", group=ID, layout=c(3,1))
> xyplot(BW ~ DrugWeek | Group, data = vcaplong, type="l", group=ID, layout=c(3,1))
> 
> ##
> ## Example multigroup (g=3) nbp-matching using the branch and bound algorithm, 
> ## and subsequent random allocation of submatches to 3 arms
> ##
> 
> # Construct an Euclidean distance example distance matrix using 15 observations from the VCaP study
> d <- as.matrix(dist(vcapwide[1:15,c("PSAWeek10", "BWWeek10")]))
> # Matching using the b&b algorithm to submatches of size 3 
> # (which will result in 3 intervention groups)
> bb3 <- match.bb(d, g=3)
[1] "Performing initial sorting for a good initial guess"
[1] "Computing boundaries for minimum distances in possible combinations..."
[1] "Starting branch and bound"
[1] "Branches: 18"
[1] "Bounds: 357"
[1] "Ends visited: 4"
[1] "Solution cost 73.1793785290756"
[1] "Solution: 3,1,3,5,2,4,4,5,1,2,2,5,3,4,1"
> str(bb3)
List of 6
 $ branches: num 18
 $ bounds  : num 357
 $ ends    : num 4
 $ matrix  : num [1:15, 1:15] 0 0 1 0 0 0 0 0 0 0 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:15] "ID003" "ID007" "ID008" "ID009" ...
  .. ..$ : chr [1:15] "ID003" "ID007" "ID008" "ID009" ...
 $ solution: Named num [1:15] 3 1 3 5 2 4 4 5 1 2 ...
  ..- attr(*, "names")= chr [1:15] "ID003" "ID007" "ID008" "ID009" ...
 $ cost    : num 73.2
> 
> solvec <- bb3$solution 
> # matching vector, where each element indicates to which submatch each observation belongs to
> 
> # Perform an example random allocation of the above submatches, 
> # these will be randomly allocated to 3 arms based on the submatches
> set.seed(1)
> groups <- match.allocate(solvec)
> 
> # Illustrate randomization, no baseline differences in these three artificial groups
> by(vcapwide[1:15,c("PSAWeek10", "BWWeek10")], INDICES=groups, FUN=function(x) x)
groups: Group_A
      PSAWeek10 BWWeek10
ID003     21.30     35.0
ID010      9.90     34.1
ID018     13.53     34.0
ID027      9.59     32.0
ID037     13.74     32.4
------------------------------------------------------------ 
groups: Group_B
      PSAWeek10 BWWeek10
ID025     13.13     33.3
ID032      8.49     34.9
ID040     23.62     35.9
ID045     14.27     34.8
ID047      6.57     31.9
------------------------------------------------------------ 
groups: Group_C
      PSAWeek10 BWWeek10
ID007      7.55     31.6
ID008     23.58     33.6
ID009     13.17     31.7
ID016     15.05     39.6
ID031      7.04     36.6
> 
> summary(aov(PSAWeek10 ~ groups, data = data.frame(PSAWeek10 = vcapwide[1:15,"PSAWeek10"], groups)))
            Df Sum Sq Mean Sq F value Pr(>F)
groups       2    0.5    0.23   0.006  0.994
Residuals   12  446.0   37.16               
> summary(aov(BWWeek10 ~ groups, data = data.frame(BWWeek10 = vcapwide[1:15,"BWWeek10"], groups)))
            Df Sum Sq Mean Sq F value Pr(>F)
groups       2   3.17   1.585   0.299  0.747
Residuals   12  63.56   5.297               
> 
> ##
> ## Example mixed-effects modeling of the longitudinal PSA profiles using 
> ## the actual experimental groups
> ##
> 
> exdat <- vcaplong[vcaplong[,"Group"] %in% c("Vehicle", "ARN"),]
> 
> library(lme4)
Loading required package: Matrix
Error: package or namespace load failed for ‘lme4’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/MASS/libs/MASS.so':
  /home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/MASS/libs/MASS.so: failed to map segment from shared object
Execution halted