user3022875
user3022875

Reputation: 9018

How to kick off R file with command line

I am on a windows machine and want to run a file called main.r so in the command line I put:

"C:\Program Files\R\R-3.0.2\bin\r.exe" CMD BATCH "C:\Users\myname\Desktop\R Projects\soultion\MAIN.R"

when I run this nothing happens. The command line just goes to the next line.

Can you advise what I am doing wrong?

Thank you.

Upvotes: 1

Views: 128

Answers (1)

Dason
Dason

Reputation: 61933

That is what is supposed to happen. Output gets piped to MAIN.Rout in your case. If you want the output to display in the terminal use Rscript instead of R CMD BATCH.

Upvotes: 1

Related Questions