[R] dev2bitmap from a script invoked by another process

Carel, Roland rcarel at netgenics.com
Fri Apr 28 16:48:26 CEST 2000


Issue:
I have a R script that is invoked periodically by another process. In the
script, a graphics is generated and I want to get a the image for the graph
as a jpeg.

Here is a prototypical version of the script (try.R):
plot(1)
dev2bitmap("try.jpg", type = "jpeg")

I am running R-1.0.0 on Solaris 7.

The script is invoked as: R --vanilla < try.R
A file named try.jpg is created but it contains a blank image, not the plot
created from the script.
Device inserted after plot(1) tells me that the current device is
postscript.
If I specify: postscript(file = "try.ps"), a file try.ps is created that
contains a postscript rendition of the plot. The try.jpg is also created but
is as previously described.
If I run the script in interactive mode, the file try.jpg is created and
contains the plot, as expected.

I know I can create the postscript file and then use ghostscript to convert
it but I was wondering if it is possible to create the jpeg directly from R.

Thanks for any help you might have.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list