title: How to get list of lists in R with my data
body: <p>here is the function which is working fine, but giving the output in an output which I don't want. </p>
  
  <pre><code>frequencies &lt;- {}
  
  for (k in (1:4))
  {   
      interval &lt;- (t(max_period_set[k]))
  
      intervals &lt;- round(quantile(interval,c(0,0.05,0.15,0.25,0.35,0.45,0.55,0.65,0.75,0.85,0.95,1.0)))
      frequency &lt;- {}
      for (i in (2:length(intervals)))
      {       
          count = 0;      
          for (r in (1:length(interval)))
          {
              if (r == length(interval))
              {
                  if (interval[r] &gt;= intervals[i-1] &amp;&amp; interval[r] &lt;= intervals[i])
                  {
                      count = count + 1
                  }
              }
              else
              { 
                  if (interval[r] &gt;= intervals[i-1] &amp;&amp; interval[r] &lt; intervals[i])
                  {
                      count = count + 1
                  }
              }
          }   
          frequency &lt;- c(frequency,count)
      }
      frequencies[[length(frequencies)+1]] &lt;- frequency
  }
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <pre><code>&gt; frequencies
  [[1]]
   [1] 2 6 5 4 5 4 6 5 5 5 3
  
  [[2]]
   [1] 1 7 5 4 5 4 5 6 5 5 3
  
  [[3]]
   [1] 3 5 5 4 5 4 6 5 5 5 3
  
  [[4]]
   [1] 3 5 5 4 4 6 5 5 5 5 3
  </code></pre>
  
  <p>I would like to have it in a format as follows: </p>
  
  <p>[[],[],[],[]] which is a list of list whose first element I can access like frequencies[1] to get the first list, etc... </p>
  
  <p>If it is not possible, how can I access the first list values in my current format? frequencies[1] does not give me the first list values back.</p>
  
  <p>Thanks for your help!</p>
  
  <p>Guys an another question: </p>
  
  <p>now I can access the data but r is representing the last line in different format: </p>
  
  <pre><code>[[1]]
   [1] 1.00 0.96 0.84 0.74 0.66 0.56 0.48 0.36 0.26 0.16 0.06 0.00
  
  [[2]]
   [1] 1.00 0.98 0.84 0.74 0.66 0.56 0.48 0.38 0.26 0.16 0.06 0.00
  
  [[3]]
   [1] 1.00 0.94 0.84 0.74 0.66 0.56 0.48 0.36 0.26 0.16 0.06 0.00
  
  [[4]]
   [1] 1.000000e+00 9.400000e-01 8.400000e-01 7.400000e-01 6.600000e-01 5.800000e-01 4.600000e-01 3.600000e-01 2.600000e-01 1.600000e-01 6.000000e-02 1.110223e-16
  </code></pre>
  
  <p>Why is it happening with the accuracy? the first three lines are as it should be but the last line is odd, the numbers were not infractional numbers, so it can be represented as a number with its accuracy of 2 after comma digits.</p>