[R] linux batch question
Rolf Turner
r.turner at auckland.ac.nz
Wed Oct 29 23:01:10 CET 2008
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 confid...{{dropped:9}}
More information about the R-help
mailing list