Hello list, I have encountered a problem trying to save graphs using the R-graphics menu: File|Save as. The menu suggests that files may be saved as either Metafile, Postscript, pdf, png, bmp, jpeg. When I specify any of those file formats a menu comes up requesting a file name. After providing a name R invariably hangs and has to be restarted. I am able to save files under the various formats using the command line without problems. However, sometimes it would be convenient to use the menus. I was wondering if anyone else had encountered a similar behaviour and had found a remedy. I am running are under GNU-Emacs ESS 5.3.3.> sessionInfo()Version 2.3.0 (2006-04-24) i386-pc-mingw32 attached base packages: [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" [7] "base" other attached packages: lattice "0.13-8" Regards Karl _________________________________ Dr Karl J Sommer, Department of Primary Industries, Catchment & Agriculture Services, PO Box 905 Mildura, VIC, 3502 Australia Tel: +61 (0)3 5051 4390 Fax +61 (0)3 5051 4534 Email: karl.sommer at dpi.vic.gov.au
On 1/3/2007 5:30 PM, karl.sommer at dpi.vic.gov.au wrote:> Hello list, > > I have encountered a problem trying to save graphs using the R-graphics > menu: File|Save as. The menu suggests that files may be saved as either > Metafile, Postscript, pdf, png, bmp, jpeg. > When I specify any of those file formats a menu comes up requesting a file > name. After providing a name R invariably hangs and has to be restarted. > > I am able to save files under the various formats using the command line > without problems. However, sometimes it would be convenient to use the > menus. > > I was wondering if anyone else had encountered a similar behaviour and had > found a remedy. > > I am running are under GNU-Emacs ESS 5.3.3. > >> sessionInfo() > Version 2.3.0 (2006-04-24)That version is out of date. Could you please update to the current version (2.4.1), and see if the problem persists? If so, could you please try it when running Rterm or Rgui on its own, rather than running under Emacs? Thanks. Duncan Murdoch> i386-pc-mingw32 > > attached base packages: > [1] "methods" "stats" "graphics" "grDevices" "utils" "datasets" > [7] "base" > > other attached packages: > lattice > "0.13-8" > > Regards > > Karl > > _________________________________ > Dr Karl J Sommer, > Department of Primary Industries, > Catchment & Agriculture Services, > PO Box 905 > Mildura, VIC, 3502 > Australia > > Tel: +61 (0)3 5051 4390 > Fax +61 (0)3 5051 4534 > > Email: karl.sommer at dpi.vic.gov.au > > ______________________________________________ > R-help at stat.math.ethz.ch 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.
Hello, thanks for the advice. I was aware that the version was out of date and your message prompted me to finally upgrade to the latest version 2.4.1. Unfortunately, running R under Emacs ESS, the problem I described earlier persists. I have also tried the Save as option under the standard RGui interface and this worked in both the old and the new versions of R, 2.3.0 and 2.4.1 respectively. The problem seems to be associated with Emacs ESS. However I don't have a clue where to start in order to find a solution. In general I quite like using Emacs ESS. It provides syntax highlighting and this makes scripts far easier to read than with the standard editor that comes with RGui. I would be grateful for any further hints from someone who has encountered similar problems in running R 2.4.1 through Emacs ESS 5.3.3 under Windows 2000. Regards Karl |---------+----------------------------> | | murdoch at stats.uwo| | | .ca | | | | | | 04/01/2007 10:10 | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: karl.sommer at dpi.vic.gov.au | | cc: r-help at stat.math.ethz.ch | | Subject: Re: [R] R grahics: Save as hangs computer | >------------------------------------------------------------------------------------------------------------------------------| On 1/3/2007 5:30 PM, karl.sommer at dpi.vic.gov.au wrote:> Hello list, > > I have encountered a problem trying to save graphs using the R-graphics > menu: File|Save as. The menu suggests that files may be saved as either > Metafile, Postscript, pdf, png, bmp, jpeg. > When I specify any of those file formats a menu comes up requesting afile> name. After providing a name R invariably hangs and has to be restarted. > > I am able to save files under the various formats using the command line > without problems. However, sometimes it would be convenient to use the > menus. > > I was wondering if anyone else had encountered a similar behaviour andhad> found a remedy. > > I am running are under GNU-Emacs ESS 5.3.3. > >> sessionInfo() > Version 2.3.0 (2006-04-24)That version is out of date. Could you please update to the current version (2.4.1), and see if the problem persists? If so, could you please try it when running Rterm or Rgui on its own, rather than running under Emacs? Thanks. Duncan Murdoch> i386-pc-mingw32 > > attached base packages: > [1] "methods" "stats" "graphics" "grDevices" "utils""datasets"> [7] "base" > > other attached packages: > lattice > "0.13-8" > > Regards > > Karl > > _________________________________ > Dr Karl J Sommer, > Department of Primary Industries, > Catchment & Agriculture Services, > PO Box 905 > Mildura, VIC, 3502 > Australia > > Tel: +61 (0)3 5051 4390 > Fax +61 (0)3 5051 4534 > > Email: karl.sommer at dpi.vic.gov.au > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
The good news, you don't have to shut down R. Several control-G in the *R* buffer in emacs will recover control. A second attempt in the same GUI graphics device did get the postscript file saved. A workaround for this problem is to use the command line, rather than the GUI menu, to save the file. This line dev.copy2eps() works. I discovered that it is necessary to set options(chmhelp=FALSE) when running R from emacs as the chmhelp is also freezing R and the help system. I am using R-2.4.1 on Windows. Use ?dev.copy2eps for details on the command line dev.* commands. Follow-up should go to the ess-bugs mailing list. Rich
Hello list thanks for that advice Rich. You are right a few control-G allowed me to recover and it had saved an eps file. The dev.copy2eps appears to take exactly what is visible in the graphics window and convert it to an eps file. This does the job for the moment. Opening the eps file in GSview I noticed that there is still a lot of white space in the bounding box which creates empty space when I want to include the image into a tex document. Is there a way to crop the image to remove the white space before including it in a document? Cheers Karl |---------+----------------------------> | | rmh at temple.edu | | | | | | 05/01/2007 10:03 | | | | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: karl.sommer at dpi.vic.gov.au, murdoch at stats.uwo.ca | | cc: r-help at stat.math.ethz.ch, ess-bugs at stat.math.ethz.ch | | Subject: Re: [R] R grahics: Save as hangs computer | >------------------------------------------------------------------------------------------------------------------------------| The good news, you don't have to shut down R. Several control-G in the *R* buffer in emacs will recover control. A second attempt in the same GUI graphics device did get the postscript file saved. A workaround for this problem is to use the command line, rather than the GUI menu, to save the file. This line dev.copy2eps() works. I discovered that it is necessary to set options(chmhelp=FALSE) when running R from emacs as the chmhelp is also freezing R and the help system. I am using R-2.4.1 on Windows. Use ?dev.copy2eps for details on the command line dev.* commands. Follow-up should go to the ess-bugs mailing list. Rich
An additional note. You can see the bounding box in the GSview display by clicking Options/Show Bounding Box Rich