[R] jpeg() saving blank files?

Sarah Berke skberke at gmail.com
Tue Mar 30 22:53:56 CEST 2010


Hi,

I am having trouble saving graphics from R.  jpeg() saves a file with
the correct name to the correct directory, but it consists of a blank
(white) jpeg with the specified dimensions--the image itself is not
being saved.

My code is

jpeg(filename="myfile.jpg",
		height = 2.5, width = 8, units = "in", res = 72,
		pointsize = 12, quality = 100, bg = "white",
     		restoreConsole = TRUE)

I have tried different heights and widths, thinking that I had a
margins problem, but no luck.  I have also verified that ghostscript
is installed, and that the environmental variable "R_GSCMD" is set to
the correct path to gswin32c.exe.  Oh, and the image device itself
displays properly in the R graphics window.  I can just manually save
it through the menu, but I want to have more control over the
dimensions.

I have also tried bitmap() and png() to no avail.

Any advice would be much appreciated!

Thanks,
Sarah



More information about the R-help mailing list