Resolving Warning in install.packages lib = C:\Program Files\R\R-3.6.1\library is not writable during R Package Installation
Overview
This documentation is tailored to users who are completely new to R, to the point of not even being familiar with computers, let alone programming, and are in urgent need to use R. Therefore, the explanations may be overly detailed.
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/
If you get a warning like the one above and cannot install packages when you are in a rush to use R, it often happens. This is usually the case for first-time users of R or users who were using R just fine on their computer but encounter this problem right after formatting. The main reason is that R does not have the permission to install packages. Follow the steps below to install packages.
Guide
Step 1. Navigate to the path where R is installed
First, navigate to the path where R is installed. If you didn’t do anything special when installing R, it’s probably installed in C:\Program Files\R
or C:\Program Files (x86)\R
. Open the folder that matches the version of R you installed. If several versions are mixed up, it’s recommended to completely remove all R versions and then follow Step 2.
When you open the folder corresponding to your version, you can see the folder where R is installed as above.
Step 2. Open the properties of the library folder
Right-click the library
folder and left-click Properties(R)
.
Step 3. Open the permissions window
In the security tab of the library properties, click edit to open the permissions window.
Step 4. Allow all permissions
Check to allow all permissions for all listings in the group or user names and apply. Although it might not always be necessary to go this far, detailed adjustments can be challenging for beginners, so just allow everything.
Step 5. Retry installing the package
Return to the R console and try installing the package again. If the permissions were successfully granted, you will see a successful installation message as follows.