私はループをいくつかの繰り返しで一時停止し、「ユーザー」に何らかの回答を求める考えがあります。R言語、ループを一時停止して、ユーザーに続行を依頼する
some_value = 0
some_criteria = 50
for(i in 1:100)
{
some_value = some_value + i
if(some_value > some_criteria)
{
#Here i need to inform the user that some_value reached some_criteria
#I also need to ask the user whether s/he wants to continue operations until the loop ends
#or even set new criteria
}
}
例えば
は再び、私はループを一時停止する、と彼は次のように続けたい場合はユーザーに尋ねる:「プレスY/N」
関連[Rでのキー入力を待つためにどのように?](http://stackoverflow.com/questions/15272916/how-to-wait-for-a-keypress-in-r)と[ユーザーR(RscriptとWidowsコマンドプロンプト)で入力]](http://stackoverflow.com/questions/22895370/user-input-in-r-rscript-and-widows-command-prompt) – lmo