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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: mixture.example
> ### Title: Mixture Example
> ### Aliases: mixture.example
> ### Keywords: datasets
> 
> ### ** Examples
> 
> str(mixture.example)
List of 8
 $ x       : num [1:200, 1:2] 2.5261 0.367 0.7682 0.6934 -0.0198 ...
 $ y       : num [1:200] 0 0 0 0 0 0 0 0 0 0 ...
 $ xnew    : 'matrix' num [1:6831, 1:2] -2.6 -2.5 -2.4 -2.3 -2.2 -2.1 -2 -1.9 -1.8 -1.7 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:6831] "1" "2" "3" "4" ...
  .. ..$ : chr [1:2] "x1" "x2"
 $ prob    : num [1:6831] 3.55e-05 3.05e-05 2.63e-05 2.27e-05 1.96e-05 ...
  ..- attr(*, ".Names")= chr [1:6831] "1" "2" "3" "4" ...
 $ marginal: num [1:6831] 6.65e-15 2.31e-14 7.62e-14 2.39e-13 7.15e-13 ...
  ..- attr(*, ".Names")= chr [1:6831] "1" "2" "3" "4" ...
 $ px1     : num [1:69] -2.6 -2.5 -2.4 -2.3 -2.2 -2.1 -2 -1.9 -1.8 -1.7 ...
 $ px2     : num [1:99] -2 -1.95 -1.9 -1.85 -1.8 -1.75 -1.7 -1.65 -1.6 -1.55 ...
 $ means   : num [1:20, 1:2] -0.2534 0.2667 2.0965 -0.0613 2.7035 ...
> if(interactive())par(ask=TRUE)
> x <- mixture.example$x
>  g <- mixture.example$y
>  x.mod <- lm( g ~ x)
>  # Figure 2.1:
>  plot(x, col=ifelse(g==1,"red", "green"), xlab="x1", ylab="x2")
>  coef(x.mod)
(Intercept)          x1          x2 
  0.3290614  -0.0226360   0.2495983 
>  abline( (0.5-coef(x.mod)[1])/coef(x.mod)[3], -coef(x.mod)[2]/coef(x.mod)[3])
>  ghat <- ifelse( fitted(x.mod)>0.5, 1, 0)
>  length(ghat)
[1] 200
> 
>  sum(ghat == g)
[1] 146
> 
>  1 - sum(ghat==g)/length(g)
[1] 0.27
>  #[1] 0.27
>  # Training misclassification rate
>  xnew <- mixture.example$xnew
>  dim(xnew)
[1] 6831    2
>  colnames(xnew)
[1] "x1" "x2"
> 
>  library(class)
Error: package or namespace load failed for ‘class’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/class/libs/class.so':
  /home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/class/libs/class.so: failed to map segment from shared object
Execution halted