Christophe Pallier <[EMAIL PROTECTED]> wrote:
> I would like to call R from a shell script and have it display a series
> of graphics.
> The graphics should remain visible until the user clicks or presses a key.
One trick is to use locator(1), which waits for a mouse click on a plot.
Here's a minimal Perl script that runs R, displays a plot, and exits when the
click is detected.
eval 'exec /usr/local/bin/perl -s -S $0 "$@"'
if 0;
open(SCRIPT, "| R --vanilla --slave");
print SCRIPT <<'EOF';
x11(width=5, height=3.5)
plot(1:10, 1:10)
z <- locator(1)
q()
EOF
close(SCRIPT);
--
-- David Brahm ([EMAIL PROTECTED])
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html