[R-SIG-Mac] strange behaviour when quitting

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jul 22 08:56:00 CEST 2008


Why do people call things they do not understand 'strange', and use 
subject lines that fail to mention key facts (the use of active 
bindings)?

Are you saving the workspace?  That will access the active binding (twice, 
I think).  With

.Last <- function() rm(newq, envir=.GlobalEnv)

it should work.  I tried

invisible(makeActiveBinding("newq", function(...) cat("OK\n"), .GlobalEnv))
.Last <- function() rm(newq, envir=.GlobalEnv)

successfully.



On Mon, 21 Jul 2008, Carl Witthoft wrote:

> I have delved into the darkness :-),
> and something odd is happening.  I saw this w/ a couple versions of R 2.7.x :
>
> First, I created an environment variable inside my .Rprofile (quoted below). 
> The variable itself works just fine.  Here's the strange thing: when I invoke 
> q() or hit <CMD>-q to quit R.app ,  R throws up a new Untitled window that 
> looks like it might be a new quartz window, then goes ahead and quits.
>
>
> myRprofile: (ignoring lines which work and do NOT affect the quit() behavior. 
> I tested extensively and only this binding makes a difference)
>
> makeActiveBinding("newq", function(...) { quartz() ; par(cex=0.75)}, 
> .GlobalEnv)->nullity
> rm(nullity)

I'd just wrap the call in invisible().

> A couple notes: I redirect to the variable 'nullity' so that R.app won't 
> throw anything onto the console window.   I put the ellipsis in because 
> otherwise I get a Warning about unused or missing arguments to function().
>
> I also tried putting the line
>
> rm(newq)
>
> into .Last, but that didn't help either.

Did you not get an error?

>
> thanks for advice.
> Carl
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

-- 
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



More information about the R-SIG-Mac mailing list