3

I'm trying to install ROCR package using command install.packages("ROCR"), but it gives the following error:

Warning in install.packages :


 package ‘ROCR’ is not available (for R version 3.4.4)

And the package doesn't appear in my list of packages. I also tried installing it from the install option in the "Packages" window, but it didn't work either. Do you know how I can fix this? I have also selected all repositories from setRepositories().

Thanks,

Debutant
  • 355
  • 5
  • 17
  • 1
    Does this answer your question? [How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?](https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa) – NelsonGon May 03 '20 at 17:12
  • 2
    Update R.If you go [here](https://cran.r-project.org/web/packages/ROCR/index.html), it depends on R>=3.6 – NelsonGon May 03 '20 at 17:13
  • I read this question, but the answers didn't help – Debutant May 03 '20 at 17:13
  • 2
    Update R and update with what happens. – NelsonGon May 03 '20 at 17:13

1 Answers1

3

If you cannot update your R (maybe the risk of disruption in your older R packages and codes), you can follow these steps:

  1. Download the tar.gz format from CRAN (https://cran.r-project.org/src/contrib/ROCR_1.0-11.tar.gz).
  2. Open the tar.gz file with your Archive Manager.
  3. Delete MD5 file to prevent checksum Errors.
  4. Open the DESCRIPTION file and change the line Depends: R (>= 3.6) to Depends: R (>= 3.1).
  5. Save the modified DESCRIPTION and update your tar.gz file.
  6. Open RSTUDIO and use the install button from Packages tab. Package Archive File (.tar.gz) in the Install From dropdown menu and find the modified tar.gz from browse, and push install button. Or simply use install.packages("~/ROCR_1.0-11.tar.gz", repos = NULL, type = "source") .

Although almost always it works fine, you should know without an MD5 checksum you risk yourself with security issues. However, we can almost always trust CRAN packages.

maaniB
  • 595
  • 6
  • 23