R 中的消息框 [英] MessageBox in R
问题描述
我想使用 R 创建一个消息框.简短的研究建议使用 tcltk
包.tcltk::tk_messageBox()
命令实际上在我第一次尝试时就起作用了.
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.
但是,我随后更新到 Windows 10,切换到 R 3.4.3,使用 RStudio v1.1.423.现在同样的命令不起作用,实际上是终止了 R 会话.第二项研究表明这确实是其他用户遇到的问题
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.
那么,我的问题是:有没有办法解决 tcltk
库和 R/RStudio 的兼容性问题?或者,是否有另一个包可以产生相同的结果?(我想避免尽可能地使用 shiny
,这已被建议)
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)
推荐答案
使用 Windows 7、R 3.4.3 和 RStudio 1.1.423 我有类似的问题,看起来 RStudio 挂了,但实际上,消息框已经弹出,只是它没有成为活动窗口,我必须最小化 RStudio 才能看到它.
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.
我正在运行的命令是:
tcltk::tk_messageBox(caption = "Hi", message = "what?", icon = "info", type = "yesno")
这篇关于R 中的消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!