title: create time series with a loop in R
body: <p>I have a question regarding a loop based setting for time series. I first load a data frame:</p>
  
  <pre><code>DataR &lt;- read.csv("XXX/R_Input_CSVs/DataR.csv", sep=";")
  </code></pre>
  
  <p>I would like to use a loop to generate one time series of each column in DataR. My time series should have the name of the corresponding column:</p>
  
  <pre><code>Baugewerbe&lt;-ts(DataR$Baugewerbe,freq=4,start=c(1991,3),end=c(2014,3))
  Gastgewerbe&lt;-ts(DataR$Gastgewerbe,freq=4,start=c(1991,3),end=c(2014,3))
  Handel&lt;-ts(DataR$Handel,freq=4,start=c(1991,3),end=c(2014,3))
  </code></pre>
  
  <p>...and so on</p>
  
  <pre><code>for(i in 1:ncol(DataR)){
  names(DataR[i])&lt;-ts(DataR[,i],freq=4,start=c(1991,3),end=c(2014,3))
  }
  </code></pre>
  
  <p>Unfortunately the code doesn^t work. What do i have to change?
  Thanks in advance</p>