I examined lots of manuals' examples but I could not exactly manage what I
wanted. I want to insert a function in my test code and make it an interactive
and semi-automatic process. I want the user to enter a valid number before being
able to continue and then I want the code to use that number as an input to the
next command. If the thing user supplied is not a valid number, I want the code
ask again and again until the proper response comes. How can I do this. That
part of my code looks like this:
PS: please never use the syntax "rm(list=ls())" when you give any example. User suddenly might find all his works gone if he tries to replicate your code in his current work session without noticing each and every details.