title: data frame column name from array value
body: <p>I have a array of names and I want to use these names for the column names for a data frame but I am getting some errors. I am not sure how exactly to do this, but this is what I have so far.</p>
  
  <pre><code>windspeeds = data.frame()
  cities &lt;- c("albuquerque_nm", "boston_ma", "charlotte_nc", "dallas_tx", "denver_co", "helena_mt", "louisville_ky", "pittsburgh_pa", "salt_lake_city_ut", "seattle_wa")
  for(i in 1:10){
    fastest &lt;- read.delim(paste("http://www.itl.nist.gov/div898/winds/data/nondirectional/datasets/", cities[i], ".prn", sep=""), col.names=c("NULL", "fastest", "NULL", "NULL"), skip=4, header=F, sep="")$fastest
    windspeeds$cities[i] = fastest
  }
  </code></pre>
  
  <p>I am getting this error: </p>
  
  <pre><code>Error in `$&lt;-.data.frame`(`*tmp*`, "cities", value = 59L) : 
  replacement has 1 rows, data has 0
  In addition: Warning message:
  In windspeeds$cities[i] = fastest :
  number of items to replace is not a multiple of replacement length
  </code></pre>
  
  <p>I have to convert the array to some type of string or constant?</p>