HOWTO · R

How to Install rtools in Windows

Learn when Windows R users need Rtools, how to choose a compatible release, install it, check whether R can find build tools, and troubleshoot common setup problems.

On this page

Rtools provides the build tools that Windows users need when they install some R packages from source or develop packages that compile code. You usually do not need to install it just to use R: many packages are available as prebuilt binaries. If a package needs compilation, or you plan to build one yourself, install the Rtools release that matches your R version and check whether your R session can discover its tools.

Install Rtools on Windows

Rtools is a collection of build tools for R on Windows, including compilers and utilities used when package source code must be compiled. It is intended for package installation and development tasks that require those tools; it is not a general prerequisite for every R user. This guide covers choosing a compatible release, running its installer, checking tool discovery from R, and narrowing down common setup problems.

Choose the Rtools version for your R installation

Start at the CRAN Rtools page and read the compatibility information for the Rtools releases listed there. Choose the release supported for the version of R installed on your computer. Do not select a release just because its number is newer: compatibility is tied to the R toolchain, and the available guidance can change over time.

If you have more than one R installation, check which one R or RStudio is using before choosing. The R version shown by that session is the one to match. The CRAN page is the source for current release and compatibility details; this guide does not assume a particular Rtools release is current for every installation.

Install Rtools

Download the installer for the compatible release from the CRAN page, then open the downloaded file and follow its prompts. Installer screens and their wording can differ by release, so use the options documented for the release you selected. In particular, add-to-PATH options may be presented differently or may not be needed in the same way across releases; do not assume a checkbox name or setting from an older walkthrough applies to your installer.

Use a location and options supported by that release, and let the installer finish before opening a new R or RStudio session. If the installer offers to configure tool discovery, follow its release-specific guidance. Keep the selected R version and Rtools release noted so you can check their compatibility if installation or package compilation does not work.

Verify the Rtools installation

Check whether the R session can find a build tool such as make with Sys.which(). Run this in the R or RStudio session that you use for package work:

Sys.which("make")

The returned value depends on the operating system, Rtools release, and configuration of that session. A nonempty path shows that R can locate a command with that name; it does not by itself prove that every compiler or package build requirement is correctly configured. An empty value means that this session did not find make through its current command search path. Compare the result with the setup instructions for your Rtools release and the needs of the package you are building. No particular path or output is expected across all Windows installations.

Troubleshoot Rtools installation and detection

If a package build cannot find its tools, first confirm that the Rtools release is compatible with the R version used by that session. Then close and reopen R or RStudio after installation and check tool discovery again. A session opened before installation may not reflect updated environment settings.

If Sys.which("make") does not find the command, review the configuration steps for your specific Rtools release. Check whether its installation completed and whether the documented PATH setup is in effect for the R session. Avoid copying a PATH entry from another release or computer, since installation locations and setup instructions can differ.

Permission problems depend on the destination folder and Windows account. Use a location you are allowed to write to and follow the installer’s guidance. Running an installer as administrator may help when Windows denies access to a required location, but it does not correct a version mismatch or a tool-discovery configuration problem by itself. Rtools is generally needed when your package workflow requires compilation; if you use only prebuilt packages, you may not need it.