title: NAs produced by Coercion Error and Invalid Printing Digits
body: <p>I have a function called Quote.Annuity, which takes no parameters. I prompt the user with a series of questions, such as &quot;What is your Name&quot;, &quot;DOB?&quot;, et cetera. I made sure to define my variables properly as either characters or numeric. In this case of a numeric like Payment amount being entered with commas, I utilized gsub() to obviate possible issues. But I receive an error about Forced Coercion and Invalid Printing Digits. Would appreciate it if someone could give me an idea of where in my code I made this mistake.</p>
  <p>Side Note: actPV() is previous function I already created</p>
  <pre><code>Quote.annuity &lt;- function() {
  library(lubridate)
  
  
      variable_beg &lt;- readline(&quot;Do you want an annuity quote? (Yes/No)&quot;)
      variable_beg &lt;- as.character(variable_beg)
  
     if(variable_beg == &quot;No&quot;) {
         print(&quot;Bye&quot;)
      }
  
     while(variable_beg == &quot;Yes&quot;) {
  
  
  my.name &lt;- readline(&quot;Enter name: &quot;)
  my.name &lt;- as.character(my.name)
  
  my.DOB &lt;- readline(&quot;Enter DOB: &quot;)
  my.DOB &lt;- as.Date(my.DOB)
  ##convDOB &lt;- ?lubridate::mdy(my.DOB)
  diffDays = Sys.Date() - my.DOB
  age = round(diffDays/365)
  
  
  my.gender &lt;- readline(&quot;Enter Gender(Male/Female): &quot;)
  my.gender &lt;- as.character(my.gender)
  
  my.payment &lt;- readline(&quot;Enter Payment amount: &quot;)
  my.payment &lt;- as.numeric(gsub(&quot;,&quot;, &quot;&quot;, my.payment))
  
  my.interestRate &lt;- readline(&quot;Choose either of two interest rates: 0.05 (5%) or 0.1 (10%)&quot;)
  my.interestRate &lt;- as.numeric(my.interestRate)
  
  annuity &lt;- my.payment * actPV(a = age, g = my.gender, r = my.interestRate)
  
  print(my.name, &quot; your expected annuity present value is &quot;, mean(annuity))
  break()
  }
  
  
   } # End function
  </code></pre>