[R-SIG-Mac] tilde expansion in graphics devices

Tim Bergsma timb at metrumrg.com
Mon Sep 1 15:55:53 CEST 2008


Hi.

Use of tilde in filenames passed to graphics drivers crashes R on Mac
(2.7.1.45970/i386/9.4.0/MacBookPro3,1/2/4).  This is true in the GUI
as well as on the command line.  For example...

png("~/myplot.png")
plot(cos)
dev.off()

...causes a crash.  tiff() has the same problem.  jpeg() does not
crash, but the display of the image seems unreliable.

In Windows, all three issue a warning, though png() warns on
initialization, while tiff() warns on closure.

In both Windows and Mac, setwd("~/") has the expected effect,
suggesting that tilde expansion is supportable in principle.

Apologies if this is a known problem.

Tim Bergsma , PhD.
Metrum Research Group, LLC



More information about the R-SIG-Mac mailing list