I'm exploring package building on Windows 7 but have been running into trouble after reaching the Command Prompt stage. The following thread appears to be on the same topic that I'm having trouble with, but the question remains unresolved:
The problem: whenever I try an R CMD command in Command Prompt (e.g. I've tried R CMD install pkgName
, R cmd install pkgName
, Rcmd install pkgName
, where pkgName
is a place-holder for an actual package that has been R CMD check
ed on OS X and also posted on CRAN, where I have the unzipped source in the current working directory), I get the following error message:
'R' is not recognized as an internal or external command,
operable program or batch file.
(If I try the Rcmd install pkgName
command, then the error starts out as 'Rcmd' is not ...
.) Note that even if I type in just R
in Command Prompt and hit enter, I get the same error, so I'm not even able to bring up R here, though it opens perfectly fine in its stand-alone interface.
I have examined the following guides without success in identifying the trouble:
The most immediate thing that came to mind was that the path variables in Windows were not set right, but this also has not (yet) led to the answer. For example, I have triple-checked the paths to ensure they are correct, including for the R version number, that x64
in the path name is accurate, etc.
I realize this is a complex issue to remotely diagnose, but any advice and suggestions on resolving this trouble is appreciated. For reference, below are the steps I have taken already to try to resolve this issue:
- Uninstall R and Rtools
- Install the latest version of R (2.15.0)
- Install Rtools215 to match R version 2.15.0
- Originally I let Rtools specify the path variables (turning that option on during installation). No success after this method.
I updated the path variables on my computer, where the below paths were used:
C:Rtoolsin; C:Program FilesRR-2.15.0inx64;
I've also tried the R CMD
(and Rcmd
) commands with the following paths included (note that these paths don't lead to anything on my computer, so I tried doing R CMD
/ Rcmd
with and without them specified):
C:Rtoolsperlin; C:RtoolsMinGWin;
Tried adding/removing the following path, which goes to the only other folder visible within the Rtools folder:
C:Rtoolsgcc-4.6.3;
Tried multiple variations of the R CMD
commands, as noted earlier.
- I tried this all a few months ago when I had R version 2.14.1 and Rtools214 installed, and I had the exact same trouble.
Note: I already had Cygwin installed prior to R and Rtools, and I have not installed MikTeX (yet).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…