Unable to install.package tm

I'm running Rstudio 2022.12.0, R 4.2.3.

When I tried to install "tm", I got the following:

> install.packages("tm")
Warning in install.packages :
  unable to access index for repository https://cran.case.edu/src/contrib:
  cannot open URL 'https://cran.case.edu/src/contrib/PACKAGES'
Installing package into ‘C:/Users/kgreen/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository https://cran.case.edu/src/contrib:
  cannot open URL 'https://cran.case.edu/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘tm’ 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
Warning in install.packages :
  unable to access index for repository https://cran.case.edu/bin/windows/contrib/4.2:
  cannot open URL 'https://cran.case.edu/bin/windows/contrib/4.2/PACKAGES'

So I downloaded Rtools for 4.2.3 and ran the installer (outside of Rstudio). Then I restarted RStudio and tried again, but it still can't see the Rtools. I see this question was asked before, but the answers are inappropriate ... something about setting the path to a bin directory (c:\rtools43\bin) that does not exist when I installed.

What am I missing?

I notice that the directory C:\rtools42\mingw64\bin is empty.

Rtools is not an R package and you don't need to run install.packages("Rtools").

I see a Windows binary on CRAN for the tm package. You should be able to install it directly. Please show the entire output after running


I pasted the wrong part. This is the correct one.

This seems like a connectivity issue, R is not being able to connect to the CRAN repository you have selected, these are some things to try.

  • Choose a different CRAN repository, RStudios repository is a good choice (http://cran.rstudio.com/) or you could choose one that is geographically closer to you.
  • Disable secure download setting. This might help when some download methods are not available in your system
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.
1 Like

Ah, very good. I'll try that, but I won't be able to do so until next week.
I have a temporary fix in that I went back to version 3.20 and that works for me (for whatever reason).

I'm facing same problem in R when I installed the latest version. And even I'm working on previous version of R by manually changing version in Rstudio. No One is giving proper reason as to why is latest version of R behaving this way. there has been updation several times but never faced such problem like in this latest version for installing packages

Thanks! I got back to this yesterday and forgot to try your suggestions. I just remembered this morning. Using different repositories didn't help in my case, though I see that was a good suggestion. However, your second suggestion, disabling the "Use secure download method for HTTP" worked fine! Thanks!

Read andresrcs response to me.
He mentions 3 things to check.
The second recommendation fixed the problem for me.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.