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

> ### Name: s_pen_clust
> ### Title: Fit Penalized Regression Models on Simulated Cluster Summaries
> ### Aliases: s_pen_clust
> 
> ### ** Examples
> 
> library(magrittr)
> 
> # simulation parameters
> rho = 0.90; p = 500 ;SNR = 1 ; n = 200; n0 = n1 = 100 ; nActive = p*0.10 ; cluster_distance = "tom";
> Ecluster_distance = "difftom"; rhoOther = 0.6; betaMean = 2;
> alphaMean = 1; betaE = 3; distanceMethod = "euclidean"; clustMethod = "hclust";
> cutMethod = "dynamic"; agglomerationMethod = "average"
> 
> #in this simulation its blocks 3 and 4 that are important
> #leaveOut:  optional specification of modules that should be left out
> #of the simulation, that is their genes will be simulated as unrelated
> #("grey"). This can be useful when simulating several sets, in some which a module
> #is present while in others it is absent.
> d0 <- s_modules(n = n0, p = p, rho = 0, exposed = FALSE,
+                 modProportions = c(0.15,0.15,0.15,0.15,0.15,0.25),
+                 minCor = 0.01,
+                 maxCor = 1,
+                 corPower = 1,
+                 propNegativeCor = 0.3,
+                 backgroundNoise = 0.5,
+                 signed = FALSE,
+                 leaveOut = 1:4)
 simulateDatExpr: simulating 500 genes in 5 modules.
> 
> d1 <- s_modules(n = n1, p = p, rho = rho, exposed = TRUE,
+                 modProportions = c(0.15,0.15,0.15,0.15,0.15,0.25),
+                 minCor = 0.4,
+                 maxCor = 1,
+                 corPower = 0.3,
+                 propNegativeCor = 0.3,
+                 backgroundNoise = 0.5,
+                 signed = FALSE)
 simulateDatExpr: simulating 500 genes in 5 modules.
> 
> truemodule1 <- d1$setLabels
> 
> X <- rbind(d0$datExpr, d1$datExpr) %>%
+   magrittr::set_colnames(paste0("Gene", 1:p)) %>%
+   magrittr::set_rownames(paste0("Subject",1:n))
> 
> betaMainEffect <- vector("double", length = p)
> betaMainInteractions <- vector("double", length = p)
> 
> # the first nActive/2 in the 3rd block are active
> betaMainEffect[which(truemodule1 %in% 3)[1:(nActive/2)]] <- runif(
+   nActive/2, betaMean - 0.1, betaMean + 0.1)
> 
> # the first nActive/2 in the 4th block are active
> betaMainEffect[which(truemodule1 %in% 4)[1:(nActive/2)]] <- runif(
+   nActive/2, betaMean+2 - 0.1, betaMean+2 + 0.1)
> betaMainInteractions[which(betaMainEffect!=0)] <- runif(nActive, alphaMean - 0.1, alphaMean + 0.1)
> beta <- c(betaMainEffect, betaE, betaMainInteractions)
> 
> result <- s_generate_data(p = p, X = X,
+                           beta = beta,
+                           include_interaction = TRUE,
+                           cluster_distance = cluster_distance,
+                           n = n, n0 = n0,
+                           eclust_distance = Ecluster_distance,
+                           signal_to_noise_ratio = SNR,
+                           distance_method = distanceMethod,
+                           cluster_method = clustMethod,
+                           cut_method = cutMethod,
+                           agglomeration_method = agglomerationMethod,
+                           nPC = 1)
Creating data and simulating response
Warning in k * error :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Calculating similarity matrices
TOM calculation: adjacency..
..will not use multithreading.
 Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
TOM calculation: adjacency..
..will not use multithreading.
 Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
TOM calculation: adjacency..
..will not use multithreading.
 Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
Creating CV folds from training data
Calculating number of clusters based on tom using hclust with average
                  linkage and the dynamic to determine the number of clusters
 ..cutHeight not given, setting it to 0.999  ===>  99% of the (truncated) height range in dendro.
 ..done.
Calculating number of environment clusters based on  difftom
 ..cutHeight not given, setting it to 2.31  ===>  99% of the (truncated) height range in dendro.
 ..done.
There are 2 clusters derived from the tom similarity matrix
There are 6 clusters derived from the difftom environment similarity matrix
There are a total of 8 clusters derived from the tom
                  similarity matrix and the difftom environment similarity matrix
> 
> pen_res <- s_pen_clust(x_train = result[["X_train"]],
+                        x_test = result[["X_test"]],
+                        y_train = result[["Y_train"]],
+                        y_test = result[["Y_test"]],
+                        s0 = result[["S0"]],
+                        gene_groups = result[["clustersAddon"]],
+                        summary = "pc",
+                        model = "lasso",
+                        exp_family = "gaussian",
+                        clust_type = "ECLUST",
+                        include_interaction = TRUE)
Summary measure: pc, Model: lasso, Cluster Type: ECLUST
Installing package into ‘/tmp/RtmphqaaXS/RLIBS_5988531924d7’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/glmnet_4.1-3.tar.gz'
Content type 'application/x-gzip' length 2318567 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

* installing *source* package ‘glmnet’ ...
** package ‘glmnet’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/home/ripley/developerstudio12.6/bin/CC -std=c++14 -I"/home/ripley/R/cc/include" -DNDEBUG  -I'/tmp/RtmphqaaXS/RLIBS_5988531924d7/RcppEigen/include' -I'/tmp/RtmphqaaXS/RLIBS_5988531924d7/Rcpp/include' -I/usr/local/include -Iglmnetpp/include -Iglmnetpp/src -KPIC  -O -xlibmil -xtarget=native -xcache=generic -nofstore  -c RcppExports.cpp -o RcppExports.o
"/tmp/RtmphqaaXS/RLIBS_5988531924d7/RcppEigen/include/Eigen/src/SparseCore/SparseCwiseUnaryOp.h", line 49: Error: Cannot define member of undefined specialization "unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, Eigen::internal::IteratorBased>".
"/tmp/RtmphqaaXS/RLIBS_5988531924d7/RcppEigen/include/Eigen/src/SparseCore/SparseCwiseUnaryOp.h", line 100: Error: Cannot define member of undefined specialization "unary_evaluator<CwiseUnaryView<ViewOp, ArgType>, Eigen::internal::IteratorBased>".
"/tmp/RtmphqaaXS/RLIBS_5988531924d7/RcppEigen/include/Eigen/src/SparseCore/SparseBlock.h", line 503: Error: Cannot define member of undefined specialization "unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, Eigen::internal::IteratorBased>".
"/tmp/RtmphqaaXS/RLIBS_5988531924d7/RcppEigen/include/Eigen/src/SparseCore/SparseBlock.h", line 529: Error: Cannot define member of undefined specialization "unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, Eigen::internal::IteratorBased>".
4 Error(s) detected.
*** Error code 2
make: Fatal error: Command failed for target `RcppExports.o'
Current working directory /tmp/RtmphqaaXS/working_dir/Rtmp3KaWou/R.INSTALL2876286d201c/glmnet/src
ERROR: compilation failed for package ‘glmnet’
* removing ‘/tmp/RtmphqaaXS/RLIBS_5988531924d7/glmnet’
Warning in utils::install.packages(package, ...) :
  installation of package ‘glmnet’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphqaaXS/working_dir/Rtmp8Naqbh/downloaded_packages’
Warning in p_install(package, character.only = TRUE, ...) : 
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘glmnet’
Warning in pacman::p_load(char = "glmnet") :
  Failed to install/load:
glmnet
Error in loadNamespace(x) : there is no package called ‘glmnet’
Calls: s_pen_clust ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted