0

I'm trying to run lasso. As far as I can see, glmnet is the most popular package. However, I'm unable to install it. Does anyone know why? I checked and this package was most recently updated in October 2019.

Alternatively, are there other packages you'd recommend for running lasso?

I've looked at the answers here and still can't figure out how to install glmnet. How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?

melbez
  • 960
  • 1
  • 13
  • 36
  • 1
    The message tells you that the current version of the package requires a more recent version of R than you have. So there are 2 options. (1) Obtain an older version of glmnet - [from here for example](https://mran.microsoft.com/timemachine) - and install manually. Or (2) upgrade your version of R. – neilfws Feb 03 '20 at 03:45

2 Answers2

1
library(devtools)
install_version("glmnet", version = "3.0-2") #https://cran.r-project.org/src/contrib/Archive/glmnet/
Martin Gal
  • 16,640
  • 5
  • 21
  • 39
Justin_VU
  • 11
  • 1
  • While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Sep 11 '21 at 14:29
0

Upgrading to the latest version of R (3.6.2) allowed me to download this package.

melbez
  • 960
  • 1
  • 13
  • 36