R system functions always returns error 127
As I mentioned in my comments, the R documentation reveals that in Windows the system()
function does not launch a separate shell (if needed). This is why command line commands run with system()
, but Notepad, which needs a separate window, does not run:
From the documentation for system()
:
The most important difference is that on a Unix-alike system launches a shell which then runs command. On Windows the command is run directly – use shell for an interface which runs command via a shell (by default the Windows shell cmd.exe, which has many differences from a POSIX shell).
Getting Exit Code 127 (Command not Found) from php exec()
So after further investigation.. I found that this was indeed a permissions issue. I had double checked that node and everything in the /bin folder had appropriate execute permissions..
What I had missed (and am not sure how it got changed) was that the /bin folder itself didn't have the appropriate execute permissions. Adding those immediately fixed my issue.
Why do I need to run find_rtools() before has_devel() = TRUE?
Basically, you did not put the rtools install location on the system PATH
variable. So, devtools::find_rtools()
is scanning the registry and adding it. The addition is only valid for the active session.
Now, the devtools::has_devel()
is a very simple build and link of a C++ file. Thus, running devtools::has_devel()
without the necessary environment (e.g. a valid rtools install) will yield a failure. In this case, the environment simply is not setup right as the system PATH
variable has not been modified.
Make sure the following are in your system path variable:
C:\Rtools\bin
and C:\Rtools\gcc-4.6.3\bin
Check within a clean R session:
Sys.getenv("PATH")
Related Topics
Downloading Files from Ftp with R
Create and Call Linear Models from List
R System Functions Always Returns Error 127
Plot Negative Values in Logarithmic Scale with Ggplot 2
How to Use a Character Vector of Column Names in the Formula Argument of Dcast (Reshape2)
Stop Ggplot2 from Dropping Data Points Outside of Axis Limits
A Vector to an Upper Triangle Matrix by Row in R
Str_Extract_All: Return All Patterns Found in String Concatenated as Vector
Only Source Functions in a .R File
How to Reverse Legend (Labels and Color) So High Value Starts at Bottom
How to Overlay an Image on to a Ggplot
Check to See If a Value Is Within a Range
How to Include Custom CSS in HTMLwidgets for R And/Or Leafletr
R Cumulative Sum with a Condition and a Reset
Compute All Pairwise Differences Within a Vector in R
Difference Between Backticks and Quotes in Aes Function in Ggplot