On Thu, Jul 24, 2014 at 12:16 PM, Nick Matzke <[email protected]> wrote:

> Hi all,
>
> Hi have a series of scripts that print a lot of notes etc. to screen.  I
> have to run them on a massive set of input files. The scripts are
> self-contained and save the important output to data files in an organized
> way.  I don't need the screen output for anything.
>
> Problems:
>
> - If I run the script from the R command line, the output printed to
> Terminal got so huge that it crashed Terminal (I was running 10 of these at
> once)
>
> - I tried R CMD BATCH, but this just created .Rout files that are size 50
> GB and counting.
>
> I suppose I could be a grownup and refactor all my code with print options
> that I can turn off, but I would rather be lazy.
>
> So, is there a way to run R CMD BATCH or something similar, and NOT print
> the output to screen or to the .Rout file?
>
> I tried:
>
> R CMD BATCH --no-save , but that still seems to save the the screen output
> etc. to .Rout.
>
> Thanks,
> Nick
>


Here is one likely solution to the above question (also, I am now sending
from the email address that is subscribed to R-help):

Put:
sink("/dev/null")

...at the beginning of the script. All screen output now goes to the black
hole of /dev/null and is not saved.

At the end of the script, put
sink()

...to turn this behavior off.

(Tip courtesy of Brian O'Meara)

There may be even easier solutions, if so, I'm still interested, since I
couldn't find anything obvious googling R CMD BATCH (although this function
seems to have many options not listed in the help for R CMD BATCH).

Thanks,
Nick

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to