title: Initializing data frame with columns from a list of names in R
body: <p>I have a list of column names, such as</p>
  
  <pre><code>names = c("a","b")
  </code></pre>
  
  <p>I'd like to make an empty data frame with the column names taken from <code>names</code>, with 1 row where all values are <code>NA</code>.</p>
  
  <pre><code>"a"  "b"
  NA    NA
  </code></pre>
  
  <p>I've tried something like this:</p>
  
  <pre><code>d = data.frame()
  for(i in seq(1,length(names))) {
  d[,toString(names[i])] = NA
  }
  </code></pre>
  
  <p>Doesn't seem to work</p>