在 R 中生成一个弹出框 [英] Generate a Pop-up box in R

查看:31
本文介绍了在 R 中生成一个弹出框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以让用户在 R 中输入值时出现弹出框?我已经将一对使用 readline 执行等效功能的行放在一起,但是是否可以使提示出现在控制台以外的其他地方?谢谢!

Is it possible to make a pop-up box appear to the user to input a value in R? I've put together a pair of lines that perform the equivalent function using readline, but is it possible to make the prompt appear somewhere other than the console? Thank you!

推荐答案

这个对类似问题的回答 展示了如何使用 tcltk 包做你想做的事(实际上它做的更多,所以可以根据你的需要缩短).代码比 Josh O'Brien 建议的 svDialogs 选项长,但不需要安装额外的包(tcltk 是使用 R 安装的包之一).

This answer to a similar question shows how to do what you want using the tcltk package (actually it does a little bit more, so could be shortened for what you want). The code is longer than the svDialogs option suggested by Josh O'Brien, but does not require the installation of an additional package (tcltk is one of those that install with R).

这篇关于在 R 中生成一个弹出框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆