0

I'm using glmnet R package. And before today I had no problems using it. I installed caret two days ago, I had some troubles to install it but I succeeded to do some by re-installing some packages like.

Here is the error message I get :

Error in .fixupDimnames(.Object@Dimnames) : 
could not find function "lengths"

I'm using an old version of R, that I can't update right now.

sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] glmnet_2.0-2    foreach_1.4.2   Matrix_1.2-2    caret_6.0-52    ggplot2_0.9.3.1 lattice_0.20-23 ade4_1.6-2     

loaded via a namespace (and not attached):
 [1] BradleyTerry2_1.0-6 brglm_0.5-9         car_2.0-19          codetools_0.2-11    colorspace_1.2-4    compiler_3.0.2     
 [7] dichromat_2.0-0     digest_0.6.4        grid_3.0.2          gtable_0.1.2        gtools_3.5.0        iterators_1.0.7    
[13] labeling_0.2        lme4_1.1-8          MASS_7.3-29         minqa_1.2.4         munsell_0.4.2       nlme_3.1-111       
[19] nloptr_1.0.4        nnet_7.3-7          plyr_1.8            pROC_1.8            proto_0.3-10        RColorBrewer_1.0-5 
[25] Rcpp_0.12.0         reshape2_1.2.2      scales_0.2.3        splines_3.0.2       stats4_3.0.2        stringr_0.6.2      
[31] tools_3.0.2 

The error is obtained after calling :

gg <- glmnet(x=data, y=Y.train, family="binomial", alpha=0, lambda=1)

Y.train is factor, and data a matrix of dummies. But I think that the issue is not a matter of data. But it is more likely something linked with a package or something like this that I'm missing. If anybody has a clue, it would be great.

Martin
  • 131
  • 1
  • 2
  • I am not sure, but this question is most likely a SO material. – Dawny33 Aug 12 '15 at 12:42
  • 1
    This may not be the issue, but as an aside, you should never specify just one lambda value to GLMNET, but instead supply it a sequence. This is explained in the documentation. – Sycorax Aug 12 '15 at 13:04
  • 2
    Your R version is two years old, perhaps try installing a similarly outdated version of glmnet from the [CRAN archives](https://cran.r-project.org/src/contrib/Archive/glmnet/) – blmoore Aug 12 '15 at 13:06
  • @user777 : I get the same error with a sequence. But thank you. – Martin Aug 12 '15 at 13:10
  • @blmoore : it is an idea, thank you. But what is strange is that I could use it some days ago before I battle in order to install "caret"... And then I can use caret's train() function with random forest for instance but not with "glmnet". I'm probably going to have to wait the update. – Martin Aug 12 '15 at 13:13
  • Yes.. I'm sorry, I asked it again on stack overflow since it was more relevant there than on cross-validated. I'm quite new here. – Martin Aug 12 '15 at 13:49
  • @Martin: In future, do not cross-post questions. Choose a Stack Exchange site, and **only** post the question on that site. – Matt Aug 13 '15 at 07:39

0 Answers0