[R-SIG-Mac] Bug? in R 2.6.0 with quartz.save()
Steven McKinney
smckinney at bccrc.ca
Tue Oct 23 20:54:56 CEST 2007
Unfortunately email mangling can leave this command in a state
not conducive to cut-and-paste
> local({e<-attach(NULL,name="tools:RGUI"); assign
+ ("quartz.save",function(file, type="png", device=dev.cur(), ...)
Error: syntax error
> invisible(.Call("QuartzSaveContents",device,file,type,list(...))),e)})
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
> quartz()
> plot(0,0)
> quartz.save("foo.pdf")
>
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
>
> -----Original Message-----
> From: r-sig-mac-bounces at stat.math.ethz.ch on behalf of Simon Urbanek
> Sent: Tue 10/23/2007 6:40 AM
> To: Todd A. Johnson
> Cc: r-sig-mac at stat.math.ethz.ch
> Subject: Re: [R-SIG-Mac] Bug? in R 2.6.0 with quartz.save()
>
>
> On Oct 17, 2007, at 1:58 AM, Todd A. Johnson wrote:
>
> > 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"
> >
>
> 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
>
>
> > 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
> >
> > _______________________________________________
> > R-SIG-Mac mailing list
> > R-SIG-Mac at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> >
> >
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
More information about the R-SIG-Mac
mailing list