title: Repeat rows of a data.frame
body: <p>I want to repeat the rows of a data.frame, each <code>N</code> times. The result should be a new <code>data.frame</code> (with <code>nrow(new.df) == nrow(old.df) * N</code>) keeping the data types of the columns.</p>
  
  <p>Example for N = 2:</p>
  
  <pre><code>                        A B   C
    A B   C             1 j i 100
  1 j i 100     --&gt;     2 j i 100
  2 K P 101             3 K P 101
                        4 K P 101
  </code></pre>
  
  <p>So, each row is repeated 2 times and characters remain characters, factors remain factors, numerics remain numerics, ...</p>
  
  <p>My first attempt used apply: <code>apply(old.df, 2, function(co) rep(co, each = N))</code>, but this one transforms my values to characters and I get:</p>
  
  <pre><code>     A   B   C    
  [1,] "j" "i" "100"
  [2,] "j" "i" "100"
  [3,] "K" "P" "101"
  [4,] "K" "P" "101"
  </code></pre>