title: How to add multiple columns to a data.frame in one go?
body: <p>I have following dataframe and vector: </p>
  
  <pre><code>ddf = data.frame(a=rep(1,10), b=rep(2,10))
  xx = c("c", "d", "e", "f")
  </code></pre>
  
  <p>How can I new empty columns which are named with items in xx ?</p>
  
  <p>I tried following but it does not work:</p>
  
  <pre><code>ddf = cbind(ddf, data.frame(xx))
  Error in data.frame(..., check.names = FALSE) : 
    arguments imply differing number of rows: 10, 4
  </code></pre>
  
  <p>Following also does not work:</p>
  
  <pre><code>for(i in 1:length(xx)){
      ddf$(xx[i]) = ""  
  }
  
  Error: unexpected '(' in:
  "for(i in 1:length(xx)){
  ddf$("
   }
  Error: unexpected '}' in "}"
  </code></pre>