From JARauh at web.de  Tue Dec  6 16:28:32 2016
From: JARauh at web.de (Johannes Rauh)
Date: Tue, 6 Dec 2016 16:28:32 +0100
Subject: [Rd] system2 fails with quiet=TRUE,
	but runs through with quiet=FALSE
Message-ID: <trinity-aaf3f5f8-1f55-4987-b755-b1ea583914a9-1481038112088@3capp-webde-bs03>

Hi,

I have recently tried to check the test coverage using library("covr") and, interestingly, the command

> covr::package_coverage()

fails, while

> covr::package_coverage(quiet = FALSE)

runs through without problem.  I traced the problem to a call to utils::install.packages(), where the option quiet is passed on.  In utils::install.packages(), the problem seems to lie in the following call of system2():

  output <- if (quiet)
    FALSE else ""
  [...]
  status <- system2(cmd0, args, env = env, stdout = output,
                        stderr = output)

Manually changing stdout to "" makes the program run through without error (but then the output is there again, of course...).

The function system2 seems to be a wrapper around

  .Internal(system(command, flags, f, stdout, stderr))

In this call, if quiet = TRUE, then flags <- 21, otherwise flags <- 22.  stdout and stderr are passed through from system2.

I should mention that I am working with R 3.3.1 on Windows 8.

Does anyone have an idea what the flags mean and how they can make a system call fail?

Best
Johannes



[Rd] system2 fails with quiet=TRUE, but runs through with quiet=FALSE
Johannes Rauh