How to create a popup warning that the script is over?

7

I would like to display a pop-up warning that the code just ran.

The only script I have, below, is what opens a command window.

system('CMD /C "ECHO O seu script chegou ao fim! && PAUSE"', 
        invisible=FALSE, wait=FALSE)
    
asked by anonymous 02.09.2014 / 16:28

2 answers

3

Well, your answer is a possibility.

Another and use the package rpanel . For this, you will need to have tcl / tk and the BWidget package installed. Then, inside the% w_ of%, do:

install.packages("rpanel")

Now you can do something like:

rp.messagebox("Popup usando rpanel", title="Titulo criativo")

That on my pc will generate the following window:

Detail that this popup will block the session.

    
02.09.2014 / 18:52
3

Another solution is to use the tcltk package. This package is already installed in R, although it does not appear in the list of CRAN packages.

require(tcltk)
tkmessageBox(title = 'Exemplo tcltk', message = 'Operação concluída!', type = 'ok')

As with the rpanel package, the session will be blocked. If you do not want to block, use a progressbar, from the utils package.

 invisible(winProgressBar(title = "Concluido!", label = "Operação concluída!", initial = 1))

If the goal is to get attention, you can also use alarm() to make a sound.

    
05.09.2014 / 15:28