How to set Rtools PATH for R
This is how I solved it:
- By looking at my
PATH
variable, which you get through
Sys.getenv("PATH")
I saw that it pointed rtools
to c:\rtools40\
. However, this should be c:\rtools40\usr\bin
. I edited the environment Variable accordingly. Here is an instruction how to edit the environment variables on windows.
- I also added this to the
.Renviron
file:
PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"
The .Renviron
file should be created/located accordingly to this location
Sys.getenv("HOME")
Sys.which( make ) empty although Rtools is in PATH
For posterity: the problem was that the "$" doesn't belong in the path.
Thanks to @r2evans for the solution - Sys.setenv(PATH=gsub("^\\$", "", Sys.getenv("PATH")))
did the trick.
Rtools 4.0 not found during package installation
Rtools40
requires that you add its bin directory to your PATH
variable. The full instructions are here.
You can update your ~/.Renviron
file with any of the following methods:
You can do that manually by opening ~/.Renviron
and putting the following in it:
PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"
You can also use R (Gui or RStudio or Shell) with the following:
writeLines(
'PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"',
con = file("~/.Renviron", open = "a")
)
Both of these methods require a restart of R.
Install two versions of rtools
The problem was due to the fact that Microsoft R Client version 3.5.2
, was installed in a path with space E:\Program Files\Microsoft\R Client
, it was solved by installing it in a path without spaces E:\Microsoft\R-Client
, such as suggested in: Message error 'C:/Program' not found with Rcpp
Related Topics
Filling in Missing (Blanks) in a Data Table, Per Category - Backwards and Forwards
Change Path.Expand Location (Win 7)
Calculate Number of Days Between Two Dates in R
Adding New Column with Conditional Values Using Ifelse
Split a Vector by Its Sequences
How to Load Data Quickly into R
Risks of Using Setwd() in a Script
Possible to Create Rd Help Files for Objects Not in a Package
R Tm Package Vcorpus: Error in Converting Corpus to Data Frame
Merge Dataframes, Different Lengths
R Shiny Table Not Rendering HTML
Mutate Multiple Variable to Create Multiple New Variables
(Igraph) Grouped Layout Based on Attribute
Matching a Sequence in a Larger Vector