0

I am using with an version 3.6.2. I already referred this post in forum but doesn't seem to help. The package can be found here

I am trying to install package but unfortunately it throws error as shown below. I get either of the below 2 errors

Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) unable to access index for repository https://OHDSI.github.io/drat/bin/windows/contrib/3.6: cannot open URL 'https://OHDSI.github.io/drat/bin/windows/contrib/3.6/PACKAGES'

Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) installation of package ‘C:/Users/test/AppData/Local/Temp/RtmpEzlckw/file29a84d6a1a43/Aphrodite_2.0.tar.gz’ had non-zero exit status

Can someone help me resolve this error? I am not a tech person but any help to resolve this will be very useful

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
The Great
  • 7,215
  • 7
  • 40
  • 128
  • Do I really have to update the R version for it to work? Else don't I have any other option? – The Great Mar 21 '20 at 07:39
  • Many packages (e.g., rlang, dplyr, ggplot2) require at least R >= 3.2.0 to work. It's probably a good idea to update to the latest R version anyway. [R 4.0.0 will be released in a month](http://developer.r-project.org/blosxom.cgi/R-devel/NEWS) – Tung Mar 21 '20 at 07:44
  • 1
    Can you download the package sources then take whatever the functions that are useful and make them work with recent R versions? – Tung Mar 21 '20 at 07:45
  • @Tung - I am someone who relies on the packages as is. I am not from a tech background. So is there any tutorial for it? – The Great Mar 21 '20 at 07:46
  • I usually just download the package source, unzip and find the function that I need – Tung Mar 21 '20 at 07:55
  • Do you want to use `devtools` to install a package from github? In that case you also try to get the source of that package as a *.tar.gz an then install it with `install.packages()`. Like this: `install.packages("path/to/package.tar.gz", repos = NULL)`. In general if you would let us know, what you need `devtools` for and what the name of the package is that requires you to use 3.1.2, that would help us help you. – Till Mar 21 '20 at 08:18
  • Okay, I need `devtools` for installing a package called `APHRODITE` from OHDSI repository – The Great Mar 21 '20 at 08:37
  • I was able to install and load that package from R 3.6.2. That doesn't mean that everything will work, but it usually does. If I was you, I would try updating to the current R Version and then try to install the package again. – Till Mar 21 '20 at 08:48
  • @Till - I get the above error when I try to install the package using `R 3.6.2`. `Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) unable to access index for repository https://OHDSI.github.io/drat/bin/windows/contrib/3.6: cannot open URL 'https://OHDSI.github.io/drat/bin/windows/contrib/3.6/PACKAGES'` – The Great Mar 21 '20 at 10:21
  • @Till - When I restart R studio and try again, I get the below error `Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) installation of package ‘C:/Users/ephssmk/AppData/Local/Temp/RtmpSYIjVb/file38981c63d61/Aphrodite_2.0.tar.gz’ had non-zero exit status` – The Great Mar 21 '20 at 10:37
  • Usually when that happens you have a message before the error, telling you that one of the dependencies did not install. Try to install missing dependencies on their own and then try the `Aphrodite` package again. – Till Mar 21 '20 at 14:04
  • Hi @Till - I tried your suggestions. All the depdencies are installed separately. But for some reason I see this error `Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) unable to access index for repository https://OHDSI.github.io/drat/bin/windows/contrib/3.6: cannot open URL 'https://OHDSI.github.io/drat/bin/windows/contrib/3.6/PACKAGES'`. Clearly no idea why.. I installed all the dependent packages separately using install_packages command.. Any help please? – The Great Mar 21 '20 at 15:35
  • I deleted all my R packages in folder and reinstalled them again but still the same above error – The Great Mar 21 '20 at 15:37
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/210108/discussion-between-the-great-and-till). – The Great Mar 22 '20 at 15:20
  • @Ben Bolker - I did try with 3.5.2 version and it still I get the same error `Error: Failed to install 'Aphrodite' from GitHub: (converted from warning) unable to access index for repository https://OHDSI.github.io/drat/bin/windows/contrib/3.5: cannot open URL 'https://OHDSI.github.io/drat/bin/windows/contrib/3.5/PACKAGES'` – The Great Mar 22 '20 at 15:21
  • Can help me with this related post please? https://stackoverflow.com/questions/60809413/how-to-install-a-zip-folder-as-a-r-package-using-r – The Great Mar 23 '20 at 07:30

1 Answers1

1

So the issue turned out to be the "error converted to warning" scenario, as described here

Setting Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true") before the install command solves the issue.

RoB
  • 1,833
  • 11
  • 23