在Rstudio中,rmd文件里两句很简单的代码:
tp <- readline(prompt="please enter yes:")
if(tp!="yes") stop("you are wrong")
却无法交互式输入,命令窗口直接得到如下结果(连续的输出):
tp <- readline(prompt="please enter yes:")
please enter yes:
if(tp!="yes") stop("you are wrong")
错误: you are wrong
请问这是什么原因呢?