title: In R, how can I filter a data frame by data type using dplyr?
body: <p>I am still learning R and would really appreciate it if someone could show me a simple way to filter a data frame by data type (i.e. only factors) using dplyr so that the output is just a list of variables of the chosen data type? </p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT:</p>
  
  <p>As it was kindly pointed out, I am missing an example (first post, sorry!). I am trying to do something like the following:</p>
  
  <pre><code>df %&gt;%
    filter(typeof(.) == "integer") %&gt;%
    names()
  </code></pre>
  
  <p>The above just returns all of the variables in my data frame, not just those of type integer which is what I would like. I would like to be able to filter for other data types as well, not just integers :)</p>