title: R CMD on Windows 7 Error - "R" is not recognized as an internal or external command,
body: <p>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:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/4740697/cannot-install-r-package-in-windows-7">Cannot install R package in Windows 7</a></li>
  </ul>
  
  <p>The problem: whenever I try an R CMD command in Command Prompt (e.g. I've tried <code>R CMD install pkgName</code>, <code>R cmd install pkgName</code>, <code>Rcmd install pkgName</code>, where <code>pkgName</code> is a place-holder for an actual package that has been <code>R CMD check</code>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:</p>
  
  <pre><code>'R' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>(If I try the <code>Rcmd install pkgName</code> command, then the error starts out as <code>'Rcmd' is not ...</code>.) Note that even if I type in just <code>R</code> 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.</p>
  
  <p>I have examined the following guides without success in identifying the trouble:</p>
  
  <ul>
  <li><a href="http://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html" rel="noreferrer">Karl W Broman's website</a></li>
  <li><a href="http://robjhyndman.com/researchtips/building-r-packages-for-windows/" rel="noreferrer">Rob J Hyndman's website</a></li>
  <li><a href="http://stevemosher.wordpress.com/ten-steps-to-building-an-r-package-under-windows/" rel="noreferrer">Steven Mosher's blog</a></li>
  </ul>
  
  <p>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 <code>x64</code> in the path name is accurate, etc.</p>
  
  <p>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:</p>
  
  <ul>
  <li>Uninstall R and Rtools</li>
  <li>Install the latest version of <a href="http://cran.r-project.org/bin/windows/base/" rel="noreferrer">R (2.15.0)</a></li>
  <li>Install <a href="http://cran.r-project.org/bin/windows/Rtools/" rel="noreferrer">Rtools215</a> to match R version 2.15.0</li>
  <li>Originally I let Rtools specify the path variables (turning that option on during installation). No success after this method.</li>
  <li><p>I updated the path variables on my computer, where the below paths were used:</p>
  
  <pre><code>C:\Rtools\bin; C:\Program Files\R\R-2.15.0\bin\x64;
  </code></pre></li>
  <li><p>I've also tried the <code>R CMD</code> (and <code>Rcmd</code>) commands with the following paths included (note that these paths don't lead to anything on my computer, so I tried doing <code>R CMD</code> / <code>Rcmd</code> with and without them specified):</p>
  
  <pre><code>C:\Rtools\perl\bin; C:\Rtools\MinGW\bin;
  </code></pre></li>
  <li><p>Tried adding/removing the following path, which goes to the only other folder visible within the Rtools folder:</p>
  
  <pre><code>C:\Rtools\gcc-4.6.3;
  </code></pre></li>
  <li><p>Tried multiple variations of the <code>R CMD</code> commands, as noted earlier.</p></li>
  <li>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.</li>
  </ul>
  
  <p>Note: I already had Cygwin installed prior to R and Rtools, and I have not installed MikTeX (yet).</p>