How to run an R script file from the command line -


i know there lot of questions regarding issue i've tried , think don't understand how command line works in windows. have file saved in folder on desktop, let's say:

c:\users\abika_000\desktop\r models\myfile.r 

here directory r/bin or rscript/bin:

c:\program files\r\r-3.1.0\bin 

i want run code using cmd prompt. how go doing this?

i've tried solution question below keep getting errors no matter do:

run r script command line

what entered:

> r cmd batch c:\users\abika_000\desktop\r models\myfile.r > rscript c:\users\abika_000\desktop\r models\myfile.r 

the errors are:

'r' not recognized internal or external command, operable program or batch file 'rscript' not recognized internal or external command, operable program or batch file 

edit::

credit splendour , phil. wound fixing entering:

> "c:\program files\r\r-3.1.0\bin\"r cmd batch "c:\users\abika_000\desktop\r models\myfile.r" 

i apologize poor question. wasn't sure how use cmd prompt /directories in trying use r cmd batch or rscript

i think step 1, if haven't done it, use unix-y shell emulator, such cygwin. then, assuming it's available on windows (as on linux/osx), can use wrapper program rscript.

or, if have unix-y shell emulator, can pipe input straight r, e.g.:

r --no-save --no-restore < your_script.r 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -