title: use for loop with pipes in R
body: <p>I am using pipes in R using magrittr library. I need to use for loop in between of the pipes, how would i do that</p>
  
  <pre><code>tmrank.ft &lt;- regulartable(
  data = tm.rank.out) %&gt;% 
  theme_booktabs() %&gt;% 
  autofit() %&gt;%
  merge_v(j=missing_species) %&gt;%
  align(align = 'center') %&gt;%
  align(align = 'center', part = 'header') %&gt;% 
  bold(part = 'header') %&gt;%
  height(height = 1, part = 'header') %&gt;% 
  fontsize(size = 14, part = 'all') %&gt;% 
  width(j=1, width = 1.0 ) %&gt;%
  width(j=2:ncol(tm.rank.out), width = 2.5) %&gt;%
  {
  for (ii in 2:length(species))
  {
    group_result &lt;- group_vector(tm.rank.out.temp, grp.type, species[ii])
    for (jj in 1:length(group_result))
    {
      text_color &lt;- grp.clr[[unique(grp.type[,grp][jj])]]
      color(i = group_result[[jj]], j = ~ species[ii], color = text_color)
    }
  }
  }
  </code></pre>
  
  <p>it throws me </p>
  
  <blockquote>
    <p>Error in inherits(x, "flextable") : 
      argument "x" is missing, with no default</p>
  </blockquote>