[R] Issues getting R to write image files
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Jun 11 14:02:02 CEST 2009
q() does call the internal version of graphics.off() which closes all
open graphics devices.
On Thu, 11 Jun 2009, Mario Valle wrote:
> Has tried to close the image file at the end?
> Do:
> dev.off()
>
> Hope it helps
> mario
> Kenny Larsen wrote:
>> Hi All,
>> 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.)) q()
>> The data file is simply 2 columns of real numbers. The system it is running
>> on is a linux box from the command line, but does have the Xlibrarys and
>> can
>> clearly write tiff's as it managed it with the filled contours.
>> Bear in mind I only started with both linux and R a couple of days ago, so
>> be gentle if it is something silly!
>> Cheers,
>> Kenny
>>
>>
>
>
> --
> Ing. Mario Valle
> Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle
> Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60
> v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list