title: Initializing and creating a data frame in R
body: <p>I have experimented with different solutions (including several
  discussed on stackoverflow and the R help thread) for a couple of days.
  None has produced a good solution. Hence this posting.</p>
  
  <p>I need to create a data frame </p>
  
  <pre><code>df &lt;- as.data.frame (matrix (nrow = 3470, ncol = 22,000)
  </code></pre>
  
  <p>The first 3 columns are character / string data. rest are numerical data. The mixed mode screwed up this approach.</p>
  
  <pre><code>df &lt;- data.frame (c1 = char(22,000), c2 = char(22,000), c3 = char(22,000), .....)
  </code></pre>
  
  <p>Is there any way to set columns 4 to 22,000 as numeric in this solution? (then I can use colnames (df) to set the real names).</p>
  
  <p>While initializing data frames with something like</p>
  
  <pre><code> df &lt;- data.frame (c1 = char(22,000), c2 = char(22,000), c3 = char(22,000), .....)
  </code></pre>
  
  <p>is there a mechanism for using something like rep to declare that c4 to c22,000 are
  numeric?</p>
  
  <p>Thank you very much. (I know initializing data frame has been discussed several
  times. I tried several approaches, yet to find a good solution). Hence this post to
  a topic that has been beaten to death.</p>