PhilR
PhilR

Reputation: 91

Invoking R in Linux

I'm porting an application written in R that currently runs under Windows over to Linux (Fedora 12) and am having some problems. Currently, under Windows I invoke R to run as a batch process as:

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

This little batch gem executes the program myRprog.r and outputs the processed statements and errors/warnings to myRprog.log and the the executed results into myRprog.lst.

I would like to recreate the same behavior under Linux. I've tried many different variations of the following without success.

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

Is there a way to emulate the behavior of writing two files out (log and listing) under Linux using batch?

Thanks.

Phil Rack

Upvotes: 3

Views: 756

Answers (3)

mbq
mbq

Reputation: 18638

Try

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

there are dozens of other methods (which probably will soon appear), but this is most similar to your Windows use.

Upvotes: 2

datanalytics.com
datanalytics.com

Reputation: 996

log and lst seem to be very SASish concepts.

R CMD BATCH myRprog.r myProg.rout

will run your program and redirect all output to myProg.rout. However, you are free to modify myProg.r so that datasets and the like are written into different files that you can then capture (possibly from an external application).

Upvotes: 0

Dirk is no longer here
Dirk is no longer here

Reputation: 368647

Or, as you're on Linux, use r from littler.

Upvotes: 1

Related Questions