Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

From: Ralph Olsson <>
Date: Fri, 11 Mar 2011 14:45:15 +0000 (GMT)


Thanks for taking the time to respond.

After further investigation I suspect the "invisible=FALSE" has nothing to do with the problem we're having. It may also be a different issue to the one Jim has seen.

Jim describes the command window flashing up and disappearing. We saw this in R 2.12.1 (unpatched) on all of our windows machines, both XP and Windows 7. Under XP the issue is resolved by the patch to 2.12.1.

Under windows 7 we see no window at all. The command is not being run at all as can be tested by running system("cmd /c echo Hello World > test.txt",show.output.on.console=FALSE)

With show.output.on.console set to TRUE the command runs as expected and the file "test.txt" is created. With show.output.on.console set to FALSE no file is created and so (I assume) the command is not being run.



From: Duncan Murdoch <> Subject: Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7 To: "jim holtman" <>
Cc: "Ralph Olsson" <>, Date: Wednesday, 9 March, 2011, 20:55

On 09/03/2011 2:34 PM, jim holtman wrote:
> I see something similar on my system.  Running your command line, I
> can see the command window flashup and then disappear.

We have had issues in the past with setting the input file handle for external commands to an empty stream.  Then cmd reads from the stream, immediately hits EOF, and quits.

It should do this consistently, so the fact that some people are seeing inconsistent behaviour looks like a bug to me.  But whether it is a bug in R or a bug in Windows is hard to determine.

I'm not going to work on this in the near term (I keep getting friendly reminders of other problems I've promised to work on), but if anyone else feels like debugging it, I would suggest looking at how the file handles are handled.

Duncan Murdoch

> >  sessionInfo()
> R version 2.12.1 (2010-12-16)
> Platform: i386-pc-mingw32/i386 (32-bit)
> locale:
> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> States.1252
> [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
> attached base packages:
> [1] tcltk     stats     grDevices utils     datasets  graphics
> methods   base
> other attached packages:
>   [1] RColorBrewer_1.0-2    sqldf_0.3-5           chron_2.3-39
> gsubfn_0.5-5
>   [5] proto_0.3-8           RSQLite.extfuns_0.0.1 RSQLite_0.9-4
> DBI_0.2-5
>   [9] zoo_1.6-4             plyr_1.4
> loaded via a namespace (and not attached):
> [1] grid_2.12.1     lattice_0.19-17 tools_2.12.1
> >
> On Wed, Mar 9, 2011 at 12:14 PM, Ralph Olsson
> <>  wrote:
> >  Hello,
> >
> >  I work for a company in which a number of employees use R. Many of them like to run executables via the system function in such a way that the output of that executable is displayed in a separate window. To give an example of the behavior they require, the following command can be run in R GUI:
> >
> >  system("cmd",invisible=FALSE,show.output.on.console=FALSE)
> >
> >  The result is that a command prompt opens up and can be used interactively until it is closed. We have never had a problem with this command running R on Windows XP machines.
> >
> >  Recently a number of us have switched to PCs running Windows 7. Under this operating system the above command often, if not always, fails to open a window. Some people can successfully run the command in one R session but then fail to get a window if a second R session is started. Others cannot get a window to open at all. We've tested the command with R 2.12.1, 2.12.1 patched, 2.12.2 and 2.12.2 patched (all in both 32 and 64 bit). All of these exhibit the same problem.
> >
> >  I raised the issue as a bug (, but this was promptly closed as being "not reproducible". Since we are having issues running the above command on all of our windows 7 PCs but none of our windows XP PCs, and since whoever closed the bug clearly had no issues running the command on his or her Windows 7 PC, I'm not really sure what to do next in terms of trying to resolve the problem.
> >
> >  Can anyone shed any light on this issue? Is anyone able to reproduce it (only takes 30 seconds, just copy the above line into RGui on Windows 7 and confirm whether a command prompt opens; then, with the first session still open, try the same in a second RGui window)?
> >
> >  Any help or feedback would be appreciated,
> >
> >  Cheers,
> >
> >  Ralph
> >          [[alternative HTML version deleted]]
> >
> >  ______________________________________________
> > mailing list
> >
> >  PLEASE do read the posting guide
> >  and provide commented, minimal, self-contained, reproducible code.
> >

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 11 Mar 2011 - 14:50:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Mar 2011 - 15:20:22 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive