title: 2D lists of parameters to lapply
body: <p>Sadly was unable to realize how to do it in R, but the idea seams simple.</p>
  
  <p>What I want is a list of pairs of numbers under a range where the fist pair is the first value and the sum of first pair with the maximum length, in the end I should have something like:</p>
  
  <pre><code>somefun &lt;- function(start, end, step){...}
  l &lt;- somefun (5, 30, 5)
  l 
  #[[1]]
  #[[1]][[1]]
  #[1] 5
  #
  #[[1]][[2]]
  #[1] 10
  #
  #[[2]]
  #[[2]][[1]]
  #[1] 11
  #
  #[[2]][[2]]
  #[1] 16
  #
  #[[3]]
  #[[3]][[1]]
  #[1] 17
  #
  #[[3]][[2]]
  #[1] 22
  #
  #[[4]]
  #[[4]][[1]]
  #[1] 23
  #
  #[[4]][[2]]
  #[1] 28
  #
  #[[5]]
  #[[5]][[1]]
  #[1] 29
  
  #[[5]][[2]]
  #[1] 30
  </code></pre>
  
  <p>So, the final list should have the first <code>start</code> and the last <code>end</code> values, but the difference within each list shouldn't be larger than the step.</p>
  
  <p>Also, I don't know if it could be the best way, but my objective is pass this values with <code>lapply</code> to build a plot using grid with <code>gredExtra::grid.arrange</code></p>
  
  <p>So the list should fit in this code</p>
  
  <pre><code>p_list = lapply(myRanges, function(a,b){
    my_gg_function(myData[a:b], font=f)
  })
  
  do.call(gridExtra::grid.arrange, c(p_list, ncol=2))
  </code></pre>
  
  <p>Thanks in advance</p>