Skip to content

Bug? in R 2.6.0 with quartz.save()

3 messages · Todd A. Johnson, Simon Urbanek, Steven McKinney

#
After upgrading to R 2.6.0, I tried saving the Quartz window to a file from
R.app using quartz.save() as mentioned in the R for Mac FAQ, but received
the error message:

Error: could not find function "quartz.save"

I've recreated this error on both a Mac Pro and a G4 PowerBook.

Reinstalling R 2.5.1 over the top removes the error.

This is the simple code to recreate the bug:

quartz(width=5, height=5);
plot(c(0,0));
quartz.save("/Users/MyUserName/Desktop/test2.pdf");


Best,

Todd
6 days later
#
On Oct 17, 2007, at 1:58 AM, Todd A. Johnson wrote:

            
Indeed, a bug was introduced when removing some of the legacy fixes  
that were part of the tools:RGUI environment, thanks for the report.  
This should be now fixed in the SVN, so please try tomorrow's nightly  
build of the GUI.

A hot fix in the meantime is to paste this in the GUI:

local({e<-attach(NULL,name="tools:RGUI"); assign 
("quartz.save",function(file, type="png", device=dev.cur(), ...)  
invisible(.Call("QuartzSaveContents",device,file,type,list(...))),e)})

Cheers,
Simon
#
Unfortunately email mangling can leave this command in a state
not conducive to cut-and-paste
+ ("quartz.save",function(file, type="png", device=dev.cur(), ...) 
Error: syntax error
Error: syntax error
I hope this version is a little more robust
to email mangling.


local({e <- attach(NULL, name = "tools:RGUI");
       assign("quartz.save",
              function(file, type = "png",
                       device = dev.cur(), ...){
                invisible(.Call("QuartzSaveContents",
                                device, file, type,
                                list(...)))}, e)})

Tested in R.app 
R 2.6.0 GUI 1.21 (4815) (4815)
on Mac OS X 10.4.10
Thanks for the patch and the great ongoing
development and support for the Mac platform.

Best
Steven McKinney

Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre

email: smckinney +at+ bccrc +dot+ ca