Hi Eric.
It appears that the visible flag is being unset in the act of
printing. So the internal R variable (R_Visible) which is being
reported in the task callback is off/False, even though the object is
being printed.
I'll add a snippet of code to handle this and report the value of
R_Visible as it is before the printing is called. That should
help avoid the confusion.
We could call the task callbacks before printing and have them
"vote"/indicate whether to cancel the printing. But I have a more
general mechanism in mind for setting different output "filters".
D.
Eric Lecoutre wrote:>
> Hello,
>
> I have a question about addTaskCallback
>
> It is said that the argument visible allows to know wether the result of
> the top-level evaluation was printed or not.
>
> Nevertheless, in the following example, I encountered a problem, as it
> seems not all printed objects are visible...
>
> Could someone tell me where is the tip?
>
> TIA
>
>
>
-----------------------------------------------------------------------------
> SimpleTask <- function() {
> function(expr,value,ok,visible){
> print(visible)
> return(TRUE) } }
>
> > addTaskCallback(SimpleTask())
>
> > x<-rnorm(10)
> [ Visible= FALSE]
> > x
> [ Visible= TRUE]
> > summary(x)
> [ Visible= FALSE] !!
>
-----------------------------------------------------------------------------
>
> Eric Lecoutre
>
> ?------------------------?------------------------------------------------?
> | Eric Lecoutre | Statistics |
> | Voie du Roman Pays, 20 | Teaching assistant / Consultant |
> | 1348 Louvain-La-Neuve | Universit? de Louvain-la-Neuve |
> | Belgique | lecoutre at stat.ucl.ac.be
|
> | (+32) (0)10 47 30 50 | http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/|
> ?------------------------?------------------------------------------------?
> | We need statistical thinking, not rituals - Gigerenzer |
> ?-------------------------------------------------------------------------?
>
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
_______________________________________________________________
Duncan Temple Lang duncan at research.bell-labs.com
Bell Labs, Lucent Technologies office: (908)582-3217
700 Mountain Avenue, Room 2C-259 fax: (908)582-3340
Murray Hill, NJ 07974-2070
http://cm.bell-labs.com/stat/duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._