title: Error: missing values and NaN's not allowed if 'na.rm' is FALSE
body: <p>Trying out multiple models chapter of #r4ds and ran into an error message at the end:</p>
  
  <blockquote>
    <p>Error: missing values and NaN's not allowed if 'na.rm' is FALSE
    In addition: Warning message:
    In ns(as.numeric(Month), 4) : NAs introduced by coercion</p>
  </blockquote>
  
  <p>with</p>
  
  <pre><code>ADA_model&lt;- function(ADA_mutiple_model){
     lm(ADA ~ ns(as.numeric(Month), 4), data=ADA_mutiple_model)
  }
  
  ADA_mutiple_model &lt;- ADA_mutiple_model %&gt;% 
       mutate(model=map(data,ADA_model)) 
  </code></pre>
  
  <p>as the code I used that creates the error.</p>
  
  <p>See mod3 below to see what the function looks like</p>
  
  <p><a href="https://i.stack.imgur.com/KhS3h.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KhS3h.png" alt="enter image description here"></a></p>