title: having issue to create one data.frame from a list of lists
body: <p>I have a <code>list</code> called <code>WI</code> containing a list of <code>two</code> including <code>S1</code> &amp; <code>S2</code>, and each sub list further contains a list of <code>10</code> representing  data.frames.</p>
  <p>I need to create one dataframe from that lists. But I have an issue, I am getting a data.frame containing only one level called <code>&quot;ndvi.mean&quot;</code> for both <code>S1</code> and <code>S2</code>, as I need ten levels include <code>&quot;gridded_idw2_sum&quot; &quot;Mada4_sum&quot;, &quot;Mada22_sum&quot;, &quot;Mada38_sum&quot;, &quot;Mada53_sum&quot;, &quot;GDD.AS_sum&quot;, &quot;GDD.Ch_sum&quot;, &quot;hum.AS.mean&quot;, &quot;hum.Ch.mean&quot;, &quot;ndvi.mean&quot;</code>.</p>
  <p>At the end I want get a data.frame containign five cols <code>&quot;year&quot; &quot;aggre_per&quot; &quot;value&quot; &quot;WI&quot; &quot;&quot;Season&quot;&quot;</code>. The <code>aggre_per</code> column has to contain 10 levels <code>&quot;gridded_idw2_sum&quot; &quot;Mada4_sum&quot;, &quot;Mada22_sum&quot;, &quot;Mada38_sum&quot;, &quot;Mada53_sum&quot;, &quot;GDD.AS_sum&quot;, &quot;GDD.Ch_sum&quot;, &quot;hum.AS.mean&quot;, &quot;hum.Ch.mean&quot;, and &quot;ndvi.mean&quot;</code>, and the <code>Season</code> column has to contain two levels <code>S1</code> and <code>S2</code>.</p>
  <p>Any solution for this issue please?</p>
  <p>Here is my <code>code</code></p>
  <pre><code>&gt; names(WI)
  [1] &quot;S1&quot; &quot;S2&quot;
  &gt; names(WI[[1]])
   [1] &quot;gridded_idw2_sum&quot; &quot;Mada4_sum&quot;        &quot;Mada22_sum&quot;       &quot;Mada38_sum&quot;      
   [5] &quot;Mada53_sum&quot;       &quot;GDD.AS_sum&quot;       &quot;GDD.Ch_sum&quot;       &quot;hum.AS.mean&quot;     
   [9] &quot;hum.Ch.mean&quot;      &quot;ndvi.mean&quot;       
  &gt; # Season 1
  &gt; for (i in 1:length(names(WI[[1]]))) {
  +   
  +   Ind &lt;- names(WI[[1]])[i]
  +   
  +   data_s1 &lt;- WI[[&quot;S1&quot;]][[Ind]]
  +   
  +     
  +   data_s1$WI &lt;- Ind
  +   data_s1$Season &lt;- &quot;S1&quot;
  +   
  + }
  &gt; 
  &gt; 
  &gt; # Season 2
  &gt; for (i in 1:length(names(WI[[1]]))) {
  +   
  +   Ind &lt;- names(WI[[2]])[i]
  +   
  +   data_s2 &lt;- WI[[&quot;S2&quot;]][[Ind]]
  + 
  +   data_s2$WI &lt;- Ind
  +   data_s2$Season &lt;- &quot;S2&quot;
  +   data_s1_s2  &lt;- rbind(data_s1, data_s2)
  +   
  + }
  &gt; head(data_s1_s2)
    year aggre_per value        WI Season
  1 2001         3  0.44 ndvi.mean     S1
  2 2002         3  0.28 ndvi.mean     S1
  3 2003         3  0.40 ndvi.mean     S1
  4 2004         3  0.31 ndvi.mean     S1
  5 2005         3  0.40 ndvi.mean     S1
  6 2006         3  0.41 ndvi.mean     S1
  &gt; #get the levels of `Season` col
  &gt; unique(data_s1_s2$Season)
  [1] &quot;S1&quot; &quot;S2&quot;
  &gt; #the levels of `WI` col
  &gt; unique(data_s1_s2$WI)
  [1] &quot;ndvi.mean&quot;
  </code></pre>
  <p>I cannot the produce the <code>dput</code> of my data because its too long. But, here is google drive link to access my data <a href="https://drive.google.com/file/d/1UJ88MRTfr_eZzAHmRw4w6fEc6ec3VGiU/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1UJ88MRTfr_eZzAHmRw4w6fEc6ec3VGiU/view?usp=sharing</a>.</p>