[R] linux batch question
markleeds at verizon.net
markleeds at verizon.net
Wed Oct 29 23:10:03 CET 2008
thanks Rolf. Yes, I meant temp.R. I was going to use test.R but then
I realized that I already had a program named that. I think the R gods
are
really hating me !!!!!!! it's a very odd thing. I'll grep the file
because maybe the output is in there somewhere and i'm missing it ?
On Wed, Oct 29, 2008 at 5:01 PM, Rolf Turner wrote:
> On 30/10/2008, at 10:46 AM, 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")
>
> Uh, you don't ack-chewally want that ``\n'' in there with
> a print() statement. (You'd want it with a cat() statement.)
>>
>> Then I did
>>
>> R CMD BATCH temp.R temp.out
>
> Did you mean ``test.R'' here, rather than ``temp.R''?
> If not, what's in ``temp.R''?
>>
>> 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.
>
> <snip>
>
> Well, it works for *me*!
>
> I made a file temp.R containing the line ``print("test of batch")
> and then did:
>
> R CMD BATCH temp.R temp.out
>
> The resulting file temp.out contained the ``test of batch'' line
> as expected/required.
>
> No problema.
>
> Clearly the R gods don't like you. :-)
>
> cheers,
>
> Rolf
>
> ######################################################################
> Attention:This e-mail message is privileged and confidential. If you
> are not theintended recipient please delete the message and notify the
> sender.Any views or opinions presented are solely those of the author.
>
> This e-mail has been scanned and cleared by
> MailMarshalwww.marshalsoftware.com
> ######################################################################
More information about the R-help
mailing list