Thomas Lumley
2005-Feb-25 15:30 UTC
[R][Rdev] any way to generate "bitmap" (tif,jpeg,png etc) files in R CMD BATCH
On Fri, 25 Feb 2005, Oleg Sklyar wrote:> Hi Community, > > here is the problem, Linux problem (reported to work on Windows). I need to > generate graphical output in any of bitmap format under the 'R CMD BATCH'. > Whereas the script generating png-s works perfectly in the R session, such > things as X11, png and jpeg are not usable in BATCH (they cannot be switched > on by --gui-X11 etc) and X11 is prompted to be required for png.FAQ 7.19 How do I produce PNG graphics in batch mode? -thomas
Prof Brian Ripley
2005-Feb-25 15:40 UTC
[Rd] [R][Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files in R CMD BATCH
Please do consult the posting guide and not post to multiple lists. On Fri, 25 Feb 2005, Oleg Sklyar wrote:> here is the problem, Linux problem (reported to work on Windows). I need to > generate graphical output in any of bitmap format under the 'R CMD BATCH'. > Whereas the script generating png-s works perfectly in the R session, such > things as X11, png and jpeg are not usable in BATCH (they cannot be switched > on by --gui-X11 etc) and X11 is prompted to be required for png. At the sameBATCH is just a script, effectively to do R --save--restore --save --no-readline < infile > outfile 2>&1 and in earlier versions includes --gui=none. So if you are running BATCH with access to an X server (unusual), you can just use the above.> time, such things as postscript and pdf, which are generally X-independent > work fine. The problem is that as a result I need something previewable in > the web browser: png, jpeg. Any suggestions how to proceed?See also ?bitmap, linked from the help page for png(). -- 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
Oleg Sklyar
2005-Feb-25 16:05 UTC
[Rd] [R][Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files in R CMD BATCH
Hi Community, here is the problem, Linux problem (reported to work on Windows). I need to generate graphical output in any of bitmap format under the 'R CMD BATCH'. Whereas the script generating png-s works perfectly in the R session, such things as X11, png and jpeg are not usable in BATCH (they cannot be switched on by --gui-X11 etc) and X11 is prompted to be required for png. At the same time, such things as postscript and pdf, which are generally X-independent work fine. The problem is that as a result I need something previewable in the web browser: png, jpeg. Any suggestions how to proceed? Generally I could use command line linux tools to convert from almost any bitmpa format to the required png or jpeg, but it would be nicer to have them as direct R output. Kind regards Oleg -- Dr Oleg Sklyar European Bioinformatics Institute Wellcome Trust Genome Campus Hinxton, Cambridge, CB10 1SD England phone/fax +44(0)1223 49 4478/4468 e-mail osklyar@ebi.ac.uk
Roger Bivand
2005-Feb-25 16:32 UTC
[Rd] Re: [R][Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files inR CMD BATCH
On Fri, 25 Feb 2005, Oleg Sklyar wrote:> Hi Community, >Use a virtual framebuffer - an example of an earlier question about this on the list is: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/15988.html (the searchable archives have lots of good tips)> here is the problem, Linux problem (reported to work on Windows). I need > to generate graphical output in any of bitmap format under the 'R CMD > BATCH'. Whereas the script generating png-s works perfectly in the R > session, such things as X11, png and jpeg are not usable in BATCH (they > cannot be switched on by --gui-X11 etc) and X11 is prompted to be > required for png. At the same time, such things as postscript and pdf, > which are generally X-independent work fine. The problem is that as a > result I need something previewable in the web browser: png, jpeg. Any > suggestions how to proceed? Generally I could use command line linux > tools to convert from almost any bitmpa format to the required png or > jpeg, but it would be nicer to have them as direct R output. > > Kind regards > Oleg > >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand@nhh.no
Simon Urbanek
2005-Feb-25 17:55 UTC
[Rd] [R][Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files in R CMD BATCH
On Feb 25, 2005, at 10:05 AM, Oleg Sklyar wrote:> here is the problem, Linux problem (reported to work on Windows). I > need to generate graphical output in any of bitmap format under the 'R > CMD BATCH'. Whereas the script generating png-s works perfectly in the > R session, such things as X11, png and jpeg are not usable in BATCHThere are other ways, but if you have (or can install) libgd and freetype, you may consider using the GDD device - it can produce jpeg, png and gif on unix w/o the need of X11. The nice thing about it is speed (it doesn't use any external process) and that it uses anti-aliasing of both text and lines. It was designed specifically for graphics-on-demand on web servers. Currenly GDD is not on CRAN (yet), but you can get it from http://www.rosuda.org/R/nightly/ Just make sure that you have libgd and freetype (if you any problems or suggestions, please drop me a line). There are other methods, too, like the bitmap device, which uses gs (AFAICS), or you can run virtual X11 to satisfy the devices that require X11. Cheers, Simon
Dirk Eddelbuettel
2005-Feb-26 02:30 UTC
[R][Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files in R CMD BATCH
Oleg, Please do not cross-post between r-devel and r-help. It is considered bad taste. On 25 February 2005 at 15:05, Oleg Sklyar wrote: | Hi Community, | | here is the problem, Linux problem (reported to work on Windows). I need | to generate graphical output in any of bitmap format under the 'R CMD | BATCH'. Whereas the script generating png-s works perfectly in the R | session, such things as X11, png and jpeg are not usable in BATCH (they | cannot be switched on by --gui-X11 etc) and X11 is prompted to be | required for png. At the same time, such things as postscript and pdf, | which are generally X-independent work fine. The problem is that as a | result I need something previewable in the web browser: png, jpeg. Any | suggestions how to proceed? Generally I could use command line linux | tools to convert from almost any bitmpa format to the required png or | jpeg, but it would be nicer to have them as direct R output. This is a FAQ, see http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-produce-PNG-graphics-in-batch-mode_003f and, say, "?bitmap" in R. Hth, Dirk -- Better to have an approximate answer to the right question than a precise answer to the wrong question. -- John Tukey as quoted by John Chambers
Seemingly Similar Threads
- [Rdev] any way to generate "bitmap" (tif, jpeg, png etc) files in R CMD BATCH
- particulars of importing/loading libraries
- display SVG, PNG, GIF, JPEG, TIFF, PPM in new plot frame
- passing command line arguments to 'R CMD BATCH myScript.R'
- assigning NULLs to elements of a list