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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: customizedGlmnet
> ### Title: fit glmnet using customized training
> ### Aliases: customizedGlmnet
> 
> ### ** Examples
> 
> require(glmnet)
Loading required package: glmnet
Loading required package: Matrix
Loaded glmnet 4.1-6
> 
> # Simulate synthetic data
> 
> n = m = 150
> p = 50
> q = 5
> K = 3
> sigmaC = 10
> sigmaX = sigmaY = 1
> set.seed(5914)
> 
> beta = matrix(0, nrow = p, ncol = K)
> for (k in 1:K) beta[sample(1:p, q), k] = 1
> c = matrix(rnorm(K*p, 0, sigmaC), K, p)
> eta = rnorm(K)
> pi = (exp(eta)+1)/sum(exp(eta)+1)
> z = t(rmultinom(m + n, 1, pi))
> x = crossprod(t(z), c) + matrix(rnorm((m + n)*p, 0, sigmaX), m + n, p)
> y = rowSums(z*(crossprod(t(x), beta))) + rnorm(m + n, 0, sigmaY)
> 
> x.train = x[1:n, ]
> y.train = y[1:n]
> x.test = x[n + 1:m, ]
> y.test = y[n + 1:m]
> 
> 
> # Example 1: Use clustering to fit the customized training model to training
> # and test data with no predefined test-set blocks
> 
> fit1 = customizedGlmnet(x.train, y.train, x.test, G = 3,
+     family = "gaussian")
> 
> # Print the customized training model fit:
> fit1

Call: 
customizedGlmnet(xTrain = x.train, yTrain = y.train, xTest = x.test, 
    G = 3, family = "gaussian")

n = 150 training observations
m = 150 test observations
p = 50 predictor variables

Model 1: 126 train obs. and 119 test obs.
Model 2: 18 train obs. and 22 test obs.
Model 3: 6 train obs. and 9 test obs.

> 
> # Extract nonzero regression coefficients for each group:
> nonzero(fit1, lambda = 10)
$`1`
   s1
1   1
2   3
3   5
4   8
5  10
6  11
7  12
8  13
9  16
10 19
11 21
12 24
13 25
14 28
15 29
16 35
17 36
18 41
19 42
20 48
21 49

$`2`
  s1
1  9
2 15
3 23
4 28
5 30
6 41
7 44
8 49
9 50

$`3`
$`3`$s1
NULL


> 
> # Compute test error using the predict function:
> mean((y.test - predict(fit1, lambda = 10))^2)
[1] 2.043481
> 
> # Plot nonzero coefficients by group:
> plot(fit1, lambda = 10)
> 
> 
> # Example 2: If the test set has predefined blocks, use these blocks to define
> # the customized training sets, instead of using clustering.
> group.id = apply(z == 1, 1, which)[n + 1:m]
> 
> fit2 = customizedGlmnet(x.train, y.train, x.test, group.id)
Error in get.knnx(xTrain, xTest[groupid == group, ]) : 
  DLL requires the use of native symbols
Calls: customizedGlmnet -> get.knnx
Execution halted