[R] Getting scan() -command to work during the program run

Atte Tenkanen attenka at utu.fi
Tue Dec 20 09:37:56 CET 2016


How to get scan(file="") command to ask my input from the keyboard?

If I put the command straight to the console it works

 > X1 <- scan(n=1)
1: 22
Read 1 item

but as a part of a program it just continues without asking my value?

 > X1 <- scan(n=1)
Read 0 items


Atte Tenkanen

More information about the R-help mailing list