title: Repeat vector to fill down column in data frame
body: <p>Seems like this very simple maneuver used to work for me, and now it simply doesn't. A dummy version of the problem:</p>
  
  <pre><code>df &lt;- data.frame(x = 1:5) # create simple dataframe
  df
    x
  1 1
  2 2
  3 3
  4 4
  5 5
  
  df$y &lt;- c(1:5) # adding a new column with a vector of the exact same length. Works out like it should
  df
   x y
  1 1 1
  2 2 2
  3 3 3
  4 4 4
  5 5 5
  
  df$z &lt;- c(1:4) # trying to add a new colum, this time with a vector with less elements than there are rows in the dataframe.
  
  Error in `$&lt;-.data.frame`(`*tmp*`, "z", value = 1:4) : 
    replacement has 4 rows, data has 5
  </code></pre>
  
  <p>I was expecting this to work with the following result:</p>
  
  <pre><code> x y z
  1 1 1 1
  2 2 2 2
  3 3 3 3
  4 4 4 4
  5 5 5 1
  </code></pre>
  
  <p>I.e. the shorter vector should just start repeating itself automatically. I'm pretty certain this used to work for me (it's in a script that I've been running a hundred times before without problems). Now I can't even get the above dummy example to work like I want to. What am I missing?</p>