Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No RTools compatible with R version 3.5.0 was found

I had problems installing data.table for R version 3.5.0, and was advised to check that RTools was properly installed.

After installing RTools 3.5 (this seems to be the latest) I typed

find_rtools(T)

I got the following message:

WARNING: Rtools is required to build R packages, but no version 
of Rtools compatible with R 3.5.0 was found. 
(Only the following incompatible version(s) of Rtools were found:3.4,3.5)

Please download and install the appropriate version of Rtools from 
http://cran.r-project.org/bin/windows/Rtools/.

So on the one hand it looks like I do have 3.5 installed, but it seems to think there is a newer/different version.

Any thoughts?

like image 362
Omry Atia Avatar asked Apr 26 '18 04:04

Omry Atia


People also ask

How do I install Rtools in R?

Installing RToolsGo to https://cran.r-project.org/, click on 'Download R for Windows', then 'Rtools', and select the very latest version of RTools to download. After downloading has completed run the installer. Select the default options everywhere.

Do you need Rtools to install packages?

The reason this is necessary is because: Rtools is a collection of software you need to be able to call R from the command line on Windows. You need to be able to call R from the command line to build and install packages from source code. Most packages will also require the program pdflatex.

How do I add Rtools to my path?

Go to "Control Panel -> System." Click on the tab "Advanced" and then on "Environment Variables." Highlight "Path" at the bottom and click "Edit". In the character string in "Variable Value", you want c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin;c:\R\bin and then any other stuff at the end.


2 Answers

The problem was Rtools 3.5 was not in your Windows system PATH thus find_rtools couldn't find it. Another possibility was that an incompatible version of Rtools was in the PATH

Best practice for installing Rtools:

  • Download the latest version

  • Install RTools at default recommended location (at the root of your C drive): C:/Rtools/

  • <Important> Check the box that allows Rtools to modify system PATH

enter image description here enter image description here

After the installation, we can double check by running this command inside R

R> Sys.getenv('PATH')
[1] "C:\\Program Files\\R\\R-3.5.0\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\mingw_64\\bin;

See also this guide


Edit: for those who don't have Administration rights, see these links:

  • Rtools with R portable
  • Building R packages on Windows without administrator access
  • Setting up RStudio Portable Default R version
like image 53
Tung Avatar answered Oct 22 '22 12:10

Tung


UPDATE

The utility find_rtools has been moved to the package pkgbuild (as noted in devtools News). The function pkgbuild::find_rtools() correctly discovers Rtools 3.5 in my system.

Old answer

I had this same problem and it occurs because devtools has not been updated to consider the newest version of RTools (3.5). Here is an easy fix that should work while they update the package:

# add missing RTools 3.5 info
v_i = devtools:::version_info
v_i[["3.5"]] = v_i[["3.4"]]
v_i[["3.5"]]$version_max = "3.5.99"
assignInNamespace(x     = "version_info",
                  value = v_i,
                  ns    = "devtools")

# now find_rtools should work properly
devtools::find_rtools()

Of course, this approach assumes that devtools::find_rtools worked for you before updating R and RTools. If this is not the case, then you might have a faulty installation and/or PATH variable as others have mentioned.

like image 35
mbiron Avatar answered Oct 22 '22 14:10

mbiron