[R] Making TIFF images with rtiff

Inman, Brant A. M.D. Inman.Brant at mayo.edu
Fri Jan 12 16:40:38 CET 2007

Thank you Peter Dalgaard.

When I open a DOS box and type gswin32c, I do indeed get an error message saying that it can't find the program.  I edited the Windows system environmental variable "Path" and the user environmental variable "PATH" (wasn't sure which to edit), to contain the follwing after a semicolon "C:\Program Files\gs\gs8.54\bin\". This effectively fixed the Dos box problem. I now get a GS prompt when I type gswin32c.

When I restart R and use the following code, I no longer get an error message.

> attach(cars)
> bitmap(file='C:\\Documents and Settings\\m007704\\Desktop\\test.tif',
+ type = "tifflzw", res = 1200)
> plot(speed ~ dist)	

Alas, if it was only that easy!  When I look on my desktop (to which the file address above correctly refers to), there is no image file of any sort to be found. Any ideas as to what I am doing wrong?

Brant Inman


It needs to be in your Path. If you open up a "DOS box" and type
gswin32c, I bet you get the same error message. You can fix this by
editing the Path (via My Computer/Properties/Advanced/Environment
variables, as you seem to know). If you use the R_GSCMD route, you may
get in trouble with the embedded space in "Program Files" ("dir/x c:"
will tell you the equivalent space-free name). Also, remember that
environment changes do not affect running programs so you may need to
exit R and restart.

   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907

More information about the R-help mailing list