R 中的命令行问题
我正在程序的 R.onload 中构建一个用户输入界面
,我想根据一组 6 个字段询问用户他们的偏好是什么。然后,这将用作程序其余部分的比较工具。
例如,
>ThisProgram
>"Hello, on a scale of 1 to 10, how much would you say you rate the outdoors in your trips? Enter a 10 for very important, and a 1 for not important at all.
>7
>"Great. on a scale of 1 to 10, how much would you say you rate the Family Friendly in your trips? Enter a 10 for very important, and a 1 for not important at all.
>2
.
.
.
and so on...
我如何让 R 向用户提问,然后将响应存储在向量中?
I am building an user input interface in R.
onload of the program, I would like like to ask the user what their preferences are according to a set of 6 fields. This will then be used as a comparison tool for the rest of the program.
e.g.,
>ThisProgram
>"Hello, on a scale of 1 to 10, how much would you say you rate the outdoors in your trips? Enter a 10 for very important, and a 1 for not important at all.
>7
>"Great. on a scale of 1 to 10, how much would you say you rate the Family Friendly in your trips? Enter a 10 for very important, and a 1 for not important at all.
>2
.
.
.
and so on...
how would I get R to ask the user a question, and then store the response in a vector?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅
?readline
See
?readline