joachim-gassen / tidycovid19

{tidycovid19}: An R Package to Download, Tidy and Visualize Covid-19 Related Data
https://joachim-gassen.github.io/tidycovid19/
Other
146 stars 44 forks source link

Difficulty accessing package #7

Closed fior-uisge closed 4 years ago

fior-uisge commented 4 years ago

So, using the code you suggested in your original post, this is what happens:

> remotes::install_github("joachim-gassen/tidycovid19")
Downloading GitHub repo joachim-gassen/tidycovid19@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                              
2: CRAN packages only               
3: None                             
4: Rcpp    (1.0.4 -> 1.0.4.6) [CRAN]
5: isoband (0.2.0 -> 0.2.1  ) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
1
countrycode  (NA    -> 1.1.1  ) [CRAN]
gtrendsR     (NA    -> 1.4.4  ) [CRAN]
shinyWidgets (NA    -> 0.5.1  ) [CRAN]
rclipboard   (NA    -> 0.1.2  ) [CRAN]
Rcpp         (1.0.4 -> 1.0.4.6) [CRAN]
isoband      (0.2.0 -> 0.2.1  ) [CRAN]
anytime      (NA    -> 0.3.7  ) [CRAN]
Installing 7 packages: countrycode, gtrendsR, shinyWidgets, rclipboard, Rcpp, isoband, anytime
Error: Failed to install 'tidycovid19' from GitHub: 
(converted from warning) unable to access index for repository https://joachim-gassen.github.io/drat/src/contrib: 
cannot open URL 'https://joachim-gassen.github.io/drat/src/contrib/PACKAGES'

I then tried with devtools::install_github("joachim-gassen/tidycovid19") and got a similare response:

> install_github("joachim-gassen/tidycovid19")
Downloading GitHub repo joachim-gassen/tidycovid19@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                              
2: CRAN packages only               
3: None                             
4: Rcpp    (1.0.4 -> 1.0.4.6) [CRAN]
5: isoband (0.2.0 -> 0.2.1  ) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
2
countrycode  (NA    -> 1.1.1  ) [CRAN]
gtrendsR     (NA    -> 1.4.4  ) [CRAN]
shinyWidgets (NA    -> 0.5.1  ) [CRAN]
rclipboard   (NA    -> 0.1.2  ) [CRAN]
Rcpp         (1.0.4 -> 1.0.4.6) [CRAN]
isoband      (0.2.0 -> 0.2.1  ) [CRAN]
anytime      (NA    -> 0.3.7  ) [CRAN]
Installing 7 packages: countrycode, gtrendsR, shinyWidgets, rclipboard, Rcpp, isoband, anytime
Error: Failed to install 'tidycovid19' from GitHub:
(converted from warning) unable to access index for repository https://joachim-gassen.github.io/drat/src/contrib:
 cannot open URL 'https://joachim-gassen.github.io/drat/src/contrib/PACKAGES'

It was only afer theis that I tried using the drat package as it allows setting up a link to the drat repository and easy installation when running scripts where you want to update data. The syntax used was:

library(drat) addRepo("joachim-gassen") install.packages("tidycovid19") This resulted in:

Warning in install.packages :
  unable to access index for repository https://joachim-gassen.github.io/drat/src/contrib:
  cannot open URL 'https://joachim-gassen.github.io/drat/src/contrib/PACKAGES'
Warning in install.packages :
  unable to access index for repository https://joachim-gassen.github.io/drat/src/contrib:
  cannot open URL 'https://joachim-gassen.github.io/drat/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘tidycovid19’ is not available (for R version 3.6.3)
Warning in install.packages :
  unable to access index for repository https://joachim-gassen.github.io/drat/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://joachim-gassen.github.io/drat/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
joachim-gassen commented 4 years ago

Thank you for posting this here.

Can you let me know what you get back when you run

getOption("repos")

For me, this returns the following (standard R/RStudio install)

                       CRAN 
"https://cran.rstudio.com/" 
attr(,"RStudio")
[1] TRUE

It seems that both install_github() calls try to access a drat repo at https://joachim-gassen.github.io/drat. There is no such repo. When it shows up in your repos option try to delete it and see whether this helps.

fior-uisge commented 4 years ago

Thanks Joachim. This was where the problem lay. I've edited the .Rprofile file to remove the drat repo