[R] Issues getting R to write image files

Tobias Verbeke tobias.verbeke at openanalytics.be
Thu Jun 11 11:24:42 CEST 2009


Hi Kenny,

> Have spent the last couple of days learning R and shell scripting to do
> batch plotting jobs. I have had success getting R to complete a filled
> contour plot and output to a file (.jpg or .tiff etc). However, when I try
> to do the same thing with the simple plot command the script seems to
> execute correctly yet there is no output. Below is my R code: 
> 
> file <- Sys.getenv("input_file") 
> tiff(paste( file, "tiff", sep=".")) 
> z <- read.table(file) 
> plot(z, type="l", xlim=range(0.6,2), col = "red", plot.title = title(main =
> file, xlab = "Wavelength (um)", ylab = "Intensity (arb.)) 

dev.off()

> q() 

You need to close the tiff graphics device you opened
using dev.off() before quitting.

HTH,
Tobias




More information about the R-help mailing list