MS-DOS & script R

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MS-DOS & script R

cindy.dol
Hi,
I would like to run R with a script from MS-DOS.
R is in "My Documents "and my script too.
How to do?
Reply | Threaded
Open this post in threaded view
|

Re: MS-DOS & script R

Uwe Ligges-3


On 04.07.2012 14:44, cindy.dol wrote:
> Hi,
> I would like to run R with a script from MS-DOS.

I don't even know how to compile R for MS-DOS to run it under that OS. I
am using R since 1998, but we used 64-bit Solaris or 32-bit Linux or
Windows systems at the time, but no DOS left.


> R is in "My Documents "

Unlikely DOS supports such a name.


> and my script too. > How to do?

Actually, I guess you are going to run R in the Windows shell.
Just add the bin path of R to the PATH environment variable, go to a
Windows command shell and start R via

Rscript filename.R

or

R CMD BATCH filename.R

from the folder where filename.R is located.

For more details and the differences of those approaches, see the manuals.

Best,
Uwe Ligges


>
> --
> View this message in context: http://r.789695.n4.nabble.com/MS-DOS-script-R-tp4635398.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: MS-DOS & script R

FJ M
In reply to this post by cindy.dol

I have the following in a batch file "TLT.BAT":
 
"C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH    "C:\Users\Frank\Documents\R\Scripts\TLT_2012.txt" "C:\Users\Frank\Documents\R\Scripts\TLT_2012.out"
PAUSE
 
The TLT_2012.txt has my R code in it. The TLT_2012.out has the output from R. Look to TLT_2012.out for problems with your batch file.
 
Frank
Chicago, IL
 

> Date: Wed, 4 Jul 2012 05:44:01 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: [R] MS-DOS & script R
>
> Hi,
> I would like to run R with a script from MS-DOS.
> R is in "My Documents "and my script too.
> How to do?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/MS-DOS-script-R-tp4635398.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
     
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.