8

I have some scripts that I run using R's batch mode.

/usr/bin/R CMD BATCH --vanilla --no-timing ~/scripts/R/sess_dur.R

I redirect the output to a file using:

> sink("~/scripts_output/R_output.txt",append=TRUE)

The problem is that when I run this script, files are created with the same name of the script and the "out" suffix (sess_dur.Rout).

There is some way to tell R not to generate these files?

micstr
  • 5,080
  • 8
  • 48
  • 76
Barata
  • 2,799
  • 3
  • 22
  • 20

1 Answers1

11

Have you tried something like:

R CMD BATCH --vanilla --no-timing ~/scripts/R/sess_dur.R /dev/null
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • 6
    just a note, it's the /dev/null at the end that sends the output elsewhere (the --vanilla and --no-timing options are unrelated) – mut1na Sep 17 '13 at 13:19
  • 1
    I don't know why that clarification was needed. The OP wanted to start with that invocation of R. – IRTFM Sep 17 '13 at 15:57
  • The `/dev/null` only works for UNIX-based. For WINDOWS, an appropriate alternative for it would be `NUL` as referred in https://stackoverflow.com/questions/313111/is-there-a-dev-null-on-windows . – venrey Apr 02 '20 at 04:59
  • I seems rather clear from the question content that the questioner was not on a windoze box. – IRTFM Apr 07 '20 at 07:45