title: Subsetting by number of levels of a variable
body: <p>I'd like to make a subset of my original dataset, that includes all columns that have not more than <code>k</code> levels. </p>
  
  <p>For dataset <code>x</code>, assuming <code>k</code> is 120:</p>
  
  <pre><code>str(x):
  $ A            : Factor w/ 1096193 levels ...
  $ B            : Factor w/ 3 levels ...
  $ C            : Factor w/ 109 levels  ...
  </code></pre>
  
  <p>Should be:</p>
  
  <pre><code>str(X'):
  $ B             : Factor w/ 3 levels ...
  $ C             : Factor w/ 109 levels  ...
  </code></pre>