3

I can't run R in cmd. I am using my company's computer, thinkpad, windows 7. My issue is similar to this post: Running R from cmd in windows

However, it's not resolved. I already tried dragging the r.exe into cmd window, which is the same as running "C:\Program Files\R\R-3.3.1\bin\R.exe", with quotes. I also tried putting the directory into the windows environment path, but it still doesn't work.

What I get is "C:\program not recognized as internal or external......."

I have done the same thing to python, and it worked. I've done the same thing on my other computer, and it worked totally fine, except that the r version and windows version are different.

Please guys, anyone have the same issue or know how to solve it? Thank you so much!!!!

Community
  • 1
  • 1
Yunfei Chen
  • 31
  • 1
  • 1
  • 2
  • 1
    You just need to put the R bin folder in your PATH then you can type Rscript.exe or R to run it. Control Panel -> System -> Environment Variables -> PATH – Hack-R Oct 04 '16 at 00:18
  • Try typing the following without quotes: `C:\Program^ Files\R\R-3.3.1\bin\R.exe` - i.e. use a carat to escape the space in Program files – Ismail Moghul Oct 04 '16 at 00:29
  • I tried that. I am at home now, so I can't take a screen shot, but I did put the bin folder into the PATH. I tried with and without double quotes. Don't know why it worked for python and my personal computer, but it just won't work for my work computer. – Yunfei Chen Oct 04 '16 at 00:29
  • Either you have the only copy of Windows in existence where PATH doesn't work or something about it is entered incorrectly. Make sure you're in the System environment variables and not just the ones for your account. Make sure you restart the terminal after you edit the PATH. Put it at the beginning of the PATH to make sure that the problem is not that you've exceeded the maximum length of the PATH. Make sure there is a `;` in between each entry on your PATH. – Hack-R Oct 04 '16 at 00:34
  • Paste it in Run (Winkey + R). Does it look ok. Press enter. Then prepend `cmd /k ` to it so `cmd /k "C:\Program Files\R\R-3.3.1\bin\R.exe"`. –  Oct 04 '16 at 00:48
  • Thank you guys. I probably didn't install the R correctly... not sure. I tried everything, quotes, ^, cmd /k but nothing worked. I ended up reinstalling R into C:\R\R-3-3.1, then it worked. Weird. – Yunfei Chen Oct 04 '16 at 13:47

0 Answers0