title: Arrange data frame columns by class: numeric before character
body: <p>Good afternoon ,</p>
  <p>Assume we have the following dataset :</p>
  <pre><code>dput(head(cylinder))
  structure(list(X19910108 = c(&quot;19910109&quot;, &quot;19910104&quot;, &quot;19910104&quot;, 
  &quot;19910111&quot;, &quot;19910104&quot;, &quot;19910111&quot;), X126 = c(&quot;X266&quot;, &quot;B7&quot;, &quot;T133&quot;, 
  &quot;J34&quot;, &quot;T218&quot;, &quot;X249&quot;), TVGUIDE = c(&quot;TVGUIDE&quot;, &quot;MODMAT&quot;, &quot;MASSEY&quot;, 
  &quot;KMART&quot;, &quot;MASSEY&quot;, &quot;ROSES&quot;), X25503 = c(25503L, 47201L, 39039L, 
  37351L, 38039L, 35751L), YES = c(&quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;, &quot;NO&quot;, &quot;YES&quot;, 
  &quot;NO&quot;), KEY = c(&quot;KEY&quot;, &quot;KEY&quot;, &quot;KEY&quot;, &quot;KEY&quot;, &quot;KEY&quot;, &quot;KEY&quot;), YES.1 = c(&quot;YES&quot;, 
  &quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;), BENTON = c(&quot;BENTON&quot;, &quot;BENTON&quot;, 
  &quot;BENTON&quot;, &quot;BENTON&quot;, &quot;BENTON&quot;, &quot;BENTON&quot;), GALLATIN = c(&quot;GALLATIN&quot;, 
  &quot;GALLATIN&quot;, &quot;GALLATIN&quot;, &quot;GALLATIN&quot;, &quot;GALLATIN&quot;, &quot;GALLATIN&quot;), 
      UNCOATED = c(&quot;UNCOATED&quot;, &quot;UNCOATED&quot;, &quot;UNCOATED&quot;, &quot;UNCOATED&quot;, 
      &quot;UNCOATED&quot;, &quot;COATED&quot;), UNCOATED.1 = c(&quot;UNCOATED&quot;, &quot;COATED&quot;, 
      &quot;UNCOATED&quot;, &quot;COATED&quot;, &quot;UNCOATED&quot;, &quot;COATED&quot;), NO = c(&quot;NO&quot;, 
      &quot;NO&quot;, &quot;NO&quot;, &quot;NO&quot;, &quot;NO&quot;, &quot;NO&quot;), LINE = c(&quot;LINE&quot;, &quot;LINE&quot;, &quot;LINE&quot;, 
      &quot;LINE&quot;, &quot;LINE&quot;, &quot;LINE&quot;), YES.2 = c(&quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;, &quot;YES&quot;, 
      &quot;YES&quot;, &quot;YES&quot;), Motter94 = c(&quot;Motter94&quot;, &quot;WoodHoe70&quot;, &quot;WoodHoe70&quot;, 
      &quot;WoodHoe70&quot;, &quot;WoodHoe70&quot;, &quot;Motter94&quot;), X821 = c(821L, 815L, 
      816L, 816L, 816L, 827L), X2 = c(2, 9, 9, 2, 2, 2), TABLOID = c(&quot;TABLOID&quot;, 
      &quot;CATALOG&quot;, &quot;CATALOG&quot;, &quot;TABLOID&quot;, &quot;CATALOG&quot;, &quot;TABLOID&quot;), NorthUS = c(&quot;NorthUS&quot;, 
      &quot;NorthUS&quot;, &quot;NorthUS&quot;, NA, &quot;NorthUS&quot;, &quot;CANADIAN&quot;), X1911 = c(NA, 
      NA, 1910L, 1910L, 1910L, 1911L), X55 = c(55, 62, 52, 50, 
      50, 50), X46 = c(46L, 40L, 40L, 46L, 40L, 46L), X0.2 = c(&quot;0.3&quot;, 
      &quot;0.433&quot;, &quot;0.3&quot;, &quot;0.3&quot;, &quot;0.267&quot;, &quot;0.3&quot;), X17 = c(15, 16, 16, 
      17, 16.8, 16.5), X78 = c(80L, 80L, 75L, 80L, 76L, 75L), X0.75 = c(0.75, 
      NA, 0.3125, 0.75, 0.4375, 0.75), X20 = c(20L, 30L, 30L, 30L, 
      28L, 30L), X13.1 = c(6.6, 6.5, 5.6, 0, 8.6, 0), X1700 = c(1900L, 
      1850L, 1467L, 2100L, 1467L, 2600L), X50.5 = c(54.9, 53.8, 
      55.6, 57.5, 53.8, 62.5), X36.4 = c(38.5, 39.8, 38.8, 42.5, 
      37.6, 37.5), X0 = c(0, 0, 0, 5, 5, 6), X0.1 = c(0, 0, 0, 
      0, 0, 0), X2.5 = c(2.5, 2.8, 2.5, 2.3, 2.5, 2.5), X1 = c(0.7, 
      0.9, 1.3, 0.6, 0.8, 0.6), X34 = c(34, 40, 40, 35, 40, 30), 
      X40 = c(40L, 40L, 40L, 40L, 40L, 40L), X105 = c(105, 103.87, 
      108.06, 106.67, 103.87, 106.67), X100 = c(100L, 100L, 100L, 
      100L, 100L, 100L), band = c(&quot;noband&quot;, &quot;noband&quot;, &quot;noband&quot;, 
      &quot;noband&quot;, &quot;noband&quot;, &quot;noband&quot;)), row.names = c(NA, 6L), class = &quot;data.frame&quot;)
  </code></pre>
  <p>The columns types are :</p>
  <pre><code>sapply(cylinder,class)
  
    X19910108        X126     TVGUIDE      X25503         YES         KEY       YES.1      BENTON    GALLATIN 
  &quot;character&quot; &quot;character&quot; &quot;character&quot;   &quot;integer&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot; 
     UNCOATED  UNCOATED.1          NO        LINE       YES.2    Motter94        X821          X2     TABLOID 
  &quot;character&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot; &quot;character&quot;   &quot;integer&quot;   &quot;numeric&quot; &quot;character&quot; 
      NorthUS       X1911         X55         X46        X0.2         X17         X78       X0.75         X20 
  &quot;character&quot;   &quot;integer&quot;   &quot;numeric&quot;   &quot;integer&quot; &quot;character&quot;   &quot;numeric&quot;   &quot;integer&quot;   &quot;numeric&quot;   &quot;integer&quot; 
        X13.1       X1700       X50.5       X36.4          X0        X0.1        X2.5          X1         X34 
    &quot;numeric&quot;   &quot;integer&quot;   &quot;numeric&quot;   &quot;numeric&quot;   &quot;numeric&quot;   &quot;numeric&quot;   &quot;numeric&quot;   &quot;numeric&quot;   &quot;numeric&quot; 
          X40        X105        X100        band 
    &quot;integer&quot;   &quot;numeric&quot;   &quot;integer&quot; &quot;character&quot; 
  </code></pre>
  <p>I want to reorder the dataset columns such that the <code>&quot;numeric&quot;</code> columns ( numeric &amp; integers ) are first at the left . The <code>&quot;character&quot;</code> columns must be at the right !</p>
  <p>Thank you for help !</p>