Skip to content

Issue when trying to install or load packages in RStudio

8 messages · Paul Bernal, Ivan Krylov, Bert Gunter +3 more

#
Dear friends,

Hope you are doing great. I have installed R version 4.2.0 and
RStudio 2022.02.2 Build 485 "Prairie Trillium" Release (8acbd38b,
2022-04-19) for Windows.

Last week, I developed a model in RStudio and was able to install and load
many packages, but now RStudio is behaving oddly.

I get the following errors whenever I try installing packages(which was not
happening to me last week):

https://cran.rstudio.com/bin/windows/Rtools/
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib
:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  package ?Rtools? is not available for this version of R

A version of this package for your version of R might be available
elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
  unable to access index for repository
https://cran.rstudio.com/bin/windows/contrib/4.2:
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/PACKAGES
'

I try to install Rtools but was not able to.

Any clues on what could be happening?

Best regards,
Paul
#
Sounds like an RStudio problem.

1. Try another repository. Try downloading packages manually from R.
See ?install.packages, ?setRepositories  .

2. Have you tried posting in RStudio's Help site: https://community.rstudio.com/

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, May 13, 2022 at 6:39 AM Paul Bernal <paulbernal07 at gmail.com> wrote:
#
A) You are repeatedly referring to RStudio... if you have a problem with RStudio, it is off-topic here and most people won't know how to fix it. RStudio occasionally gets out of sync with R and (the majority of us) don't keep track of that status here.

Assuming the problem is with R (you confirm this by using R or RGui directly and seeing the same errors)... 

B) When the R error messages say they cannot find the index, then that means you either have the wrong CRAN mirror URL (there is a whole list of them you can try) or there is some kind of network storm that will blow over if you try again later.

C) Finally, Rtools is not an R package... you will never succeed installing Rtools using install.packages. Use your web browser to look on CRAN for Rtools42 software and download the corresponding Windows setup program and run it. You should read and follow the instructions [1]. I am pretty sure you will need to re-start R so it will find Rtools.

[1] https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html
On May 13, 2022 6:38:29 AM PDT, Paul Bernal <paulbernal07 at gmail.com> wrote:

  
    
#
Dear Jeff and R friends,

I fixed the issue. The problem was due to the fact that I had R version
4.1.2 and installed  the newer version R 4.2. Since RStudio automatically
points to the latest R version installed, there were a lot of packages that
were not installed.

I just made RStudio point to an older R version and the issue was solved.

Cheers,
Paul
El El vie, 13 de may. de 2022 a la(s) 9:35 a. m., Jeff Newmiller <
jdnewmil at dcn.davis.ca.us> escribi?:

  
  
#
Hello,

If that was the problem you should run update.packages().
It can take a lot of time dpending on how many packages you have 
installed but it will avoid you having to update the packages one by one.

Hope this helps,

Rui Barradas

?s 15:57 de 13/05/2022, Paul Bernal escreveu:
#
On 5/13/22 09:47, Rui Barradas wrote:
# ITYM:

update.packages( checkBuilt=TRUE, ask=FALSE)
#
Thank you very much dear friend Rui.

Best,
Paul

El El vie, 13 de may. de 2022 a la(s) 11:48 a. m., Rui Barradas <
ruipbarradas at sapo.pt> escribi?: