title: R: argument is not numeric or logical: returning NA, as.integer()
body: <p>I'm trying to create a column (b in the example) that returns the amount of views(a in the example), per title. 
  In the Environment it shows 'int' in front of the numbers. </p>
  
  <pre><code>library(tidyverse)
  a &lt;- as.integer(dataset$a)
  b &lt;- dataset %&gt;% group_by(title) %&gt;% mean(a)
  View(b)
  </code></pre>
  
  <p>After running the code it gives the following error:</p>
  
  <pre><code>Warning message:
  In mean.default(., a) :
    argument is not numeric or logical: returning NA
  </code></pre>
  
  <p>Does any of you know how I can solve the error?</p>