[SOLVED] [R] Compiling R program on Windows - is not recognized as an internal or external command
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[R] Compiling R program on Windows - is not recognized as an internal or external command
Quote:
Originally Posted by NevemTeve
Code:
PATH C:\Progra~1\GnuWin32\bin;%PATH%
It wasn't a joke, that's how you can avoid file-names having spaces in them. (Use DIR /X to find out the short names. (When in linux, it is all-capitals: /mnt/C/PROGRA~1/))
Thanks for the tip, but see the screenshots attached:
Setting .Library.site <- file.path("C:/R/R-2.12.2/library") in my RProfile.site file was the medicine!
I changed my RProfile as follows (don't have the `site-library` thing):
Code:
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
options(help_type="html")
# set a site library
# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")
.Library.site <- file.path("C:/R/R-2.15.1/library")
# set a CRAN mirror
# local({r <- getOption("repos")
# r["CRAN"] <- "http://my.local.cran"
# options(repos=r)})
# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
# if (interactive())
# fortunes::fortune()
Now, I reinstalled R in a different directory which didn't have any spaces in its name but that didn't help either.
So, this time I replaced the manual R_HOME setting with the following statement, and the above error vanished.
The above post though solved the said error, but it also introduced new errors like:
Code:
R: command not found
Did anyone notice that I hadn't placed : before the equalto = ??
old - R_HOME = "C:\R-2.15.1"
new - R_HOME := "C:\R-2.15.1"
The original Makefile on Windows provided for demo by R contained those colons which I had removed!
Now I put those semicolons back, and the command not found errors are gone!
Also, later on I replaced the R_HOME as '/cygdrive/c/R-2.15.1' (which worked).
Last edited by Aquarius_Girl; 10-30-2012 at 06:36 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.