R 带有是/否/取消的对话框窗口

R 带有是/否/取消的对话框窗口,r,R,我如何创建一个窗口,就像我们试图关闭R时出现的窗口一样(使用是/否/取消按钮) q() 我试图找到另一个包含窗口消息的函数,但未找到(我不知道如何从q())查看源代码)您好,您可以使用packagetcltk执行此操作: library(tcltk) tkmessageBox(title = "Greetings from R TclTk", message = "Hello, world!", icon = "info", type = "ok") # for the

我如何创建一个窗口,就像我们试图关闭R时出现的窗口一样(使用是/否/取消按钮)

q()


我试图找到另一个包含窗口消息的函数,但未找到(我不知道如何从
q()
)查看源代码)

您好,您可以使用package
tcltk
执行此操作:

 library(tcltk)
 tkmessageBox(title = "Greetings from R TclTk",
         message = "Hello, world!", icon = "info", type = "ok")
 # for the one displayed by q() :
 tkmessageBox(message = "Do you want to save before quitting?",
icon = "question", type = "yesnocancel", default = "yes")