title: Running a seasonal decomposition on multiple columns in R
body: <p>I am learning to code in R and have been strugling to get something very simple to work. I have a database with prices of products, each column represents the time series of a product. I want to run a Seasonal Decomposition of Time Series on each column and get the results in a list separated by product name.</p>
  
  <p>When I run the code below I get the error:</p>
  
  <p>Error in assign(paste(j), x[j]) &lt;- (stl(dados_resumo[, x], s.window = "periodic")) :   could not find function "assign&lt;-"</p>
  
  <pre><code>for (i in 1:3)
  {
      x &lt;- (i)
      for(j in colnames(df)){
      assign(paste(j), x[j]) &lt;- (stl(df[,x], s.window="periodic"))
      }
  } 
  </code></pre>