当前位置: 动力学知识库 > 问答 > 编程问答 >

starting R in windows command terminal

问题描述:

I cannot figure out how to start R in windows command terminal. I run cmd to open Command Prompt after I type R, rcmd, start R and try other possibilities I found around but I have an error: 'R' is not recognized as an internal or external command. I have R installed and I have a short-cut on my desktop and I am able to use it as RGui but I saw people use R in similar manner as python from command line.

I have 32-bit windows 7.

网友答案:

If it's on your path type:

R.exe

To get it on your path:

Start/computer/systems properties/advanced system settings/Environment variables/in the lower box select path/Edit

then add location of R, mine is C:\R\R-2.15.1\bin but likely by default it's in program files.

This is what my variable value looks like:

C:\R\R-2.15.1\bin\i386;C:\Rtools\bin;C:\Rtools\perl\bin;C:\Rtools\gcc-4.6.3\bin;C:\Rtools\MinGW\bin;C:\R\bin;C:\Perl64\bin; C:\Program Files (x86)\MiKTeX 2.8\miktex\bin;C:\Program Files (x86)\HP SimplePass 2012\x64;C:\Program Files (x86)\HP SimplePass 2012\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Pandoc\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\gs\gs9.06\bin;C:\Program Files (x86)\LibreOffice 3.5\URE\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\; C:\Users\trinker\rubytools\bin

Then click OK three times. Now start a new command prompt and R.exe should be accessible.

分享给朋友:
您可能感兴趣的文章:
随机阅读: