Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
512 views
in Technique[技术] by (71.8m points)

executable - R.exe, Rcmd.exe, Rscript.exe and Rterm.exe: what's the difference?

I'm struggling with the different R executables. What exactly is the difference between R.exe (with or without CMD BATCH option), Rcmd.exe, Rscript.exe and Rterm.exe when running command line in a batch file?

And what is the difference between:

R.exe --no-environ --no-save < "c:empRest.R" > "c:empRout.txt" 2>&1

and

R.exe CMD BATCH --no-environ --no-save "c:empRest.R" "c:empRout.txt"

No difference in the output.

I cannot find anything about Rcmd.exe and Rscript.exe in the 3079 pages R reference manual.

By the way: I am using Windows.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Caveat: I work much more on Linux than Windows:

  • Rcmd.exe is a historical left-over as back in the day, you could not do R CMD something on Windows but needed the special executable Rcmd.exe something. That is no longer the case, yet it is provided for backwards compatibility.
  • Rterm.exe is also a holdover from the days when Rcmd.exe was used. Can be ignored these days.
  • R CMD BATCH is a crutch that was needed in the days before littler and Rscript.exe, and similarly lingering from old docs and habits..
  • Rscript.exe is your friend for batch scripts; use it.
  • For everything else, there's R.exe.

Other than that, as Marek hinted, the reference manual is the wrong one among the six available manuals. Try the Introduction to R and the Installation and Admin manuals both of which have specific appendices for Windows.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...