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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: FLXMRlmer
> ### Title: FlexMix Interface to Linear Mixed Models
> ### Aliases: FLXMRlmer FLXMRlmer-class FLXMRlmm-class FLXMRlmmfix-class
> ###   FLXdeterminePostunscaled,FLXMRlmer-method
> ###   FLXdeterminePostunscaled,FLXMRlmm-method FLXmstep,FLXMRlmer-method
> ###   FLXmstep,FLXMRlmm-method FLXgetModelmatrix,FLXMRlmer-method
> ###   FLXgetModelmatrix,FLXMRlmm-method FLXMRlmm FLXgetObs,FLXMRlmm-method
> ###   FLXmstep,FLXMRlmmfix-method predict,FLXMRlmm-method
> ###   rFLXM,FLXMRlmm,FLXcomponent-method rFLXM,FLXMRlmm,list-method
> ###   rFLXM,FLXMRlmc,FLXcomponent-method
> ###   rFLXM,FLXMRlmer,FLXcomponent-method
> ### Keywords: models
> 
> ### ** Examples
> 
> id <- rep(1:50, each = 10)
> x <- rep(1:10, 50)
> sample <- data.frame(y = rep(rnorm(unique(id)/2, 0, c(5, 2)), each = 10) +
+                          rnorm(length(id), rep(c(3, 8), each = 10)) +
+                          rep(c(0, 3), each = 10) * x,
+                      x = x,
+                      id = factor(id))
> fitted <- flexmix(.~.|id, k = 2, model = FLXMRlmm(y ~ x, random = ~ 1),
+                   data = sample, control = list(tolerance = 10^-3),
+                   cluster = rep(rep(1:2, each = 10), 25))
> parameters(fitted)
                      Comp.1   Comp.2
coef.(Intercept)  4.03960636 7.969018
coef.x            0.01234944 2.974483
sigma2.Random    12.43527939 3.107691
sigma2.Residual   0.97568435 1.146578
> 
> fitted1 <- flexmix(.~.|id, k = 2, model = FLXMRlmer(y ~ x, random = ~ 1),
+                   data = sample, control = list(tolerance = 10^-3),
+                   cluster = rep(rep(1:2, each = 10), 25))
Error in (function (cond)  : 
  error in evaluating the argument 'model' in selecting a method for function 'flexmix': there is no package called ‘lme4’
Calls: flexmix ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted