Calling R on Linux

I am porting an application written in R that is currently running on Windows prior to Linux (Fedora 12), and I am having some problems. Currently under Windows, I call R to start as a batch process as:

Rterm.exe --no-save --no-restore --quiet <myRprog.r> myRprog.log 2> & 1

This little batch pearl executes the myRprog.r program and displays the processed statements and errors / warnings in myRprog.log and the executed results in myRprog.lst.

I would like to recreate the same behavior on Linux. I tried many different options without success.

R CMD BATCH myRprog.r myRprog.lst myRprog.log

Is there a way to emulate the write behavior of two files (log and listing) on ​​Linux using a package?

Thank.

Phil rack

+3
source share
3 answers

Try

R --no-save --no-restore --quiet < myRprog.r > myRprog.log 2>&1

There are dozens of other methods (which are likely to come soon), but this is more like using Windows.

+2
source

Or, like you on Linux, use rfrom littler .

+1
source

log and lst seem to be very SASish concepts.

R CMD BATCH myRprog.r myProg.rout

launches your program and redirects all output to myProg.rout. However, you can modify myProg.r so that datasets, etc. They were recorded in different files, which can then be captured (possibly from an external application).

0
source

Source: https://habr.com/ru/post/1760083/


All Articles