[R] Issues getting R to write image files
Kenny Larsen
k.larsen at sheffield.ac.uk
Thu Jun 11 11:31:03 CEST 2009
Thanks all, I added the dev.off() and although it didn't solve it it no doubt
tidies things up on closing. I have got it working now, it is something in
the plot(....) line, as removing all teh options solves it. I will work
through adding them in one by one!
Kenny
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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
--
View this message in context: http://www.nabble.com/Issues-getting-R-to-write-image-files-tp23977785p23978106.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list