[R] Rgui maintains open file handles after Sweave error

Yihui Xie xie at yihui.name
Wed Apr 4 22:21:28 CEST 2012


Herik's suggestion is an absolutely good practice which guarantees the
device is always closed. That is what I did in the knitr package, so
you can probably take a look at http://yihui.name/knitr/

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Apr 4, 2012 at 2:52 PM, Alexander Shenkin <ashenkin at ufl.edu> wrote:
> Thanks for the reply, Henrik.  Process Explorer still shows the file
> handle as being open, but R only shows the following:
>
>> showConnections(all=TRUE)
>  description class      mode text   isopen   can read can write
> 0 "stdin"     "terminal" "r"  "text" "opened" "yes"    "no"
> 1 "stdout"    "terminal" "w"  "text" "opened" "no"     "yes"
> 2 "stderr"    "terminal" "w"  "text" "opened" "no"     "yes"
>>
>
> On 4/4/2012 2:45 PM, Henrik Bengtsson wrote:
>> See ?closeAllConnections
>>
>> Suggestion to the maintainer of Sweave: "atomify" the figure
>> generation, e.g. use { pdf(); on.exit(dev.off()); {...}; } or similar,
>> instead of { pdf(); {...}; dev.off(); } possibly by leaving a copy of
>> the fault figure file for troubleshooting.
>>
>> /Henrik
>>



More information about the R-help mailing list