[R-pkg-devel] Closing a display window from a program

J C Nash pro|jcn@@h @end|ng |rom gm@||@com
Wed Nov 13 18:14:09 CET 2024


Hi,

I'm trying to prepare a package to manage some diverse data. It is
extremely convenient to display a PDF derived from the data so the user
can verify information that the R script is going to process (even nicer
if on a 2 monitor system). I've 2 issues:

1) I can display the pdf either with file_show() from the fs package
or browseURL(). Both leave the pdf displayed and return to the
R "terminal". But when I finish processing at the end of the script,
I want to have the display close. This seems to need (non-platform-neutral)
use of a system() call to wmctrl, which is only on X-windows systems.
Note that the display tools don't seem to return a handle that I can use to
close the display window some other way. On my system both the tools
for display loaded xreader (I'm on Linux Mint Wilma).

2) the tools also don't seem to offer window size or placement, which
   would be nice.

Suggestions welcome.

John Nash



More information about the R-package-devel mailing list