title: using while loop with logical operators (AND and OR)
body: <pre><code>n&lt;-NULL
  acr&lt;-NULL
  while((is.numeric(n)==F) &amp; (acr&lt;0 ¦acr&gt;1)){
     print("enter a  positive integer and the average cancellation rate you want")
     try(n&lt;-scan(what=integer(),nmax=1), silent=TRUE);
     try(acr&lt;-scan(what=double(),nmax=1), silent=TRUE)
  }
  </code></pre>
  
  <p>I would want the users of my program to enter a positive integer which I store in "n" and the second 
  entry which I keep in "acr" is a probability so it lies between 0 and 1.
  (I don't want it to be exacly 0 or 1, though it could be according to probability theory).
  So I want the user to keep on doing the entry until they are able to enter a positive integer for "n" and a probability value between 0 and 1 for "acr".(using while with the AND, OR operators)</p>
  
  <p>However, I am having a problem with the while statement/loop. I have tried all other possibilities such as the one below, but it still doesn't work.</p>
  
  <pre><code>while(is.numeric(n)==F &amp; acr&lt;0 ¦acr&gt;1)
  </code></pre>
  
  <p>AGAIN:question 2 
  There is a problem with <code>what=double()</code> also in the <code>scan</code> function, I think.
  I know that, for example, 0.5 is a double data type in other programming languages but 
  I cannot figure it out in R(I don't know what it is called in R).
  what is the difference between <code>integer()</code> and <code>double()</code> in R? (I am not familiar with double)</p>
  
  <p>I would be highly appreciative to anyone who could come to my aid.</p>
  
  <p>many thanks to all.</p>
  
  <p>Isaac Owusu</p>