I am developing an R Shiny application on Windows 7 and would like it to communicate with the user in some ways, primarily outputting some optimization results in the form of a message box.
I tried winDialog()
function first but it seems to have only three parameters, thus it's not really customizable. I would have wanted to at least give a proper title for the appearing message box instead of the basic Information title but there doesn't seem to be such an argument. Furthermore, I also dislike winDialog()
for being totally platform dependent; if possible, I'd stick to functionalities that won't crash if I give the app to someone using an Apple product...
Then I tried using the tkmessagebox()
function from tcltk
package but sadly every time the message box appears behind the running app, which first gave me the impression of my app suddenly freezing until I eventually found the message box is hidden behind the app. This is very-very impractical for the user, having to minimize the app window every time, so this didn't solve my issue either.
winDialog(type ="ok", message = paste("Initial profit value is: ", toString(MAX_PROFIT)) )
library(tcltk)
tkmessageBox(title = "Initial profit calculation", message = toString(MAX_PROFIT), icon = "info", type = "ok")
I also came across a thread from last year here on StackOverflow, mentioning the exact same problem with the tkmessageBox
function (you can find that thread here: MessageBox in R). Apparently, there doesn't seem to be any straightforward solution for the disappearing R message boxes, or at least I haven't found any information as of now.