Reputation: 341
I am relatively new to R/RStudio. I was successfully able to install packages until today. Each time I try to install a package, I receive the following error:
*WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/my. Name/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/openintro_1.7.1.zip'
Content type 'application/zip' length 3136068 bytes (3.0 MB)
downloaded 3.0 MB*
Rtools is already installed on my machine, so I'm not sure why it's not being recognized.
I have tried un-installing and re-installing rtools but can't seem to resolve the issue. Any insight here would be greatly appreciated!
Upvotes: 34
Views: 119694
Reputation: 1
You need two things in order
Then, go to this link - https://cran.r-project.org/bin/windows/base/howto-R-devel.html Search "Rtools" in the above web page. Click on the hyperlink "installer" to install Rtools44. Open R (not R Studio) & install the rest given in order:
No setting of PATH is necessary, Rtools44 will be found automatically by R. You can check now for packages like "psych" by running library(psych). Packages with dependencies should all work now well.
Now open R Studio and you can work on such dependent (C++) libaries.
Upvotes: 0
Reputation: 467
If somoeone is still looking, be sure to check if you use the right version of Rtools. E.g. if you have R 4.3.3 install Rtools43 not Rtools44.
Upvotes: 2
Reputation: 11
In my case, I had done all of that but it didn't work so I deleted the entire "C:\Program Files\R" files and reinstalled R. I actually had two previous versions of R and Rtools and packages were not installed in the same folders
Upvotes: 1
Reputation: 52847
The message indicates RTools isn't installed properly. Download and install it like so:
A nice 2-minute video explainer can be found here.
Why is RTools necessary in the first place?
Rtools adds are some tools to allow you to build packages. Not all packages need it; just the ones that use C, C++ or Fortran code.
Upvotes: 15
Reputation: 1966
if your os is windows, you should install rtool to create a building env for some R packages.
full stack for install R Rstudio Rtool .
you can get answer from this video https://www.bilibili.com/video/BV1Mv411u7Cm?spm_id_from=333.999.0.0
Upvotes: 0