meik michalke meik.michalke at
Mon May 7 22:12:57 UTC 2018


Am Mittwoch, 25. April 2018, 11:10:59 CEST schrieb Thomas Friedrichsmeier:
> On Tue, 24 Apr 2018 12:49:17 +0200
> meik michalke <meik.michalke at> wrote:
> > i've seen in the R 3.5.0 changelog that there's a new function called
> > askYesNo() for simple interaction with the user (couldn't test it yet
> > because there's no R 3.5.0 packages for ubuntu 16.04). in RKWard it
> > should trigger a yes/no dialog.
> True. Fortunately there seems to be an option() for setting a custom
> function for this, cleanly. Any volunteer for figuring out, how exactly
> to map this to the existing

the least intrusive way of doing this seems to be setting an option:

options("askYesNo"=function(msg, default, prompts, ...){
  response <-
    stop("Unrecognized response!")
  } else {

this works out of the box, but the behaviour is not fully identical. currently ignores the default value; askYesNo() returns it 
if no answer was entered (i.e., the user just presses enter when the question 
comes up). to emulate this, should be able to preselect the 
respective button, where it currently always defaults to "yes".

so, to fully implement askYesNo() without breaking backwards compatibility, we 
could add a new argument to


and when called by askYesNo():


but rk.dialog() would have to support this -- does it, yet?

the error if response is NULL emulates what happens when a wrong value is 
entered. askYesNo() raises an error, but if you simply close the dialog it returns NULL.

viele grüße :: m.eik

  dipl. psych. meik michalke
  institut f"ur experimentelle psychologie
  abt. f"ur diagnostik und differentielle psychologie
  heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the rkward-devel mailing list