问题
I would like to create a messagebox using R. A short research suggested the tcltk
package. The tcltk::tk_messageBox()
command actually worked the first time I tried it.
However, I then I updated to Windows 10, switched to R 3.4.3, using RStudio v1.1.423. Now the same command does not work, actually terminating the R Session. A second research showed that this is indeed an issue other users have experienced as well.
So, here is my question: Is there either a way to resolve the compatibility issue of the tcltk
library and R/RStudio? Alternatively, is there another package that could produce the same result? (I would like to avoid going as far as shiny
, that has been suggested)
回答1:
With Windows 7, R 3.4.3 and RStudio 1.1.423 I have a similar problem, it looks like RStudio hangs, but in fact, the message-box has popped up, just that it does not become the active window and I have to minimize RStudio to see it.
The command I am running is:
tcltk::tk_messageBox(caption = "Hi", message = "what?", icon = "info", type = "yesno")
来源:https://stackoverflow.com/questions/49008964/messagebox-in-r