[R] Sweave and connections

Friedrich.Leisch@tuwien.ac.at Friedrich.Leisch at tuwien.ac.at
Mon Feb 7 13:04:37 CET 2005


>>>>> On Mon, 7 Feb 2005 12:32:13 +0100,
>>>>> Göran Broström (GB) wrote:

  > I'm learning to use Sweave (it's really great!) and everything works fine,
  > except that occasionally I get, after having sweaved many times, 
  > ----------------------------------------------------------
  >> Sweave("report.Snw")
  > Writing to file report.tex
  > Processing code chunks ...
  >  1 : term hide

  > Error:  chunk 1 
  > Error in file(file, encoding = encoding) : 
  >         All connections are in use
  > ----------------------------------------------------------
  > This is no big problem, since it helps to close and reopen the R session,
  > but I wonder if I can avoid this, by "closing connections" or something
  > similar. (I really have no idea of what is going on!)

This should happen only if you have errors in the Sweave document:
then Sweave may have no chance to close the output file properly.

showConnections() lists all open connections, and you may guess what
closeAllConnections() does :-)

HTH,
Fritz

-- 
-------------------------------------------------------------------
                        Friedrich Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch




More information about the R-help mailing list