[R] FW: Re: linux batch question

Martin Maechler maechler at stat.math.ethz.ch
Fri Oct 31 10:00:50 CET 2008


>>>>> "ML" == Mark Leeds <markleeds at verizon.net>
>>>>>     on Wed, 29 Oct 2008 17:13:04 -0500 (CDT) writes:

    ML> Hi Phil: That's EXACTLY what it is. Thanks so much. It's nice to know 
    ML> that the R Gods don't hate me. I hope it's okay that I'm going to cc 
    ML> r-help
    ML> in case this thread comes up in the future and also so that other people 
    ML> who might want to help know that it's solved. Thanks again.

another note below,  "just for the archives i.e. future reference":


    ML> On Wed, Oct 29, 2008 at  5:01 PM, Phil Spector wrote:

    >> Mark:
    >> 
    >>> delete workspace? (y/n):  print("test of batch\n")
    >> 
    >> It looks like you've got something in your .Rprofile or .First
    >> that's causing R to prompt you about saving your workspace, and
    >> it's interpreting your program as that response.
    >> 
    >> Try
    >> 
    >> R --no-save --vanilla CMD BATCH test.r test.out

A mini-remark:
I'd recommend *dropping* the final  'test.out',
such that R will automatically use   test.Rout
and the *.Rout ending is automagically recognized by an
ESS-enabled emacs [as "R Transcript file"]  and maybe similarly
by other R-aware editors.

Martin


    >> - Phil

    >> On Wed, 29 Oct 2008, markleeds at verizon.net wrote:
    >> 
    >>> I usually just run my R programs at the R command prompt but for my 
    >>> latest one I want to save any output that gets written to the screen 
    >>> so I am
    >>> trying to use R CMD BATCH and send the output to an output file. I 
    >>> realize I could use sink at the prompt but I'd rather try to do it 
    >>> this way
    >>> because I know that I used to do this in S+.
    >>> 
    >>> So, I wrote a simple one line program called test.R which is below.
    >>> 
    >>> print("test of batch\n")
    >>> 
    >>> Then I did
    >>> 
    >>> R CMD BATCH temp.R temp.out
    >>> 
    >>> temp.out which is shown below then ends up containing all my loading 
    >>> up messages  and a proc.time statement at the very bottom  but not 
    >>> the print statement itself ? Does someone know what I'm doing wrong. 
    >>> I've looked around but I can't find anything that answers my 
    >>> question. My sessionInfo() is at ther very bottom of this email. 
    >>> Thanks.

    ........................



More information about the R-help mailing list