title: Block bootstrapping with isplit
body: <p>I have the following example data set</p>
  
  <pre><code>Sites&lt;-c("A","A","B","B","B","C","C","C")
  TR&lt;-c(0.1,0.4,0.4,0.3,0.3,0.6,0.5,0.5)
  df&lt;-data.frame(Sites,TR)
  </code></pre>
  
  <p>I would like to subset the rows by the variable "Sites" and then bootstrap each site trap rate (TR).  I have tried using the following code</p>
  
  <pre><code>require(iterators)
  sites&lt;-isplit(df,df$Sites)
  nextElem(sites)
  require(foreach)
  mT&lt;-foreach(Sites=sites)%do%
  
  {
  meanTraps &lt;- vector()
  for(i in 1:boots){
    meanTraps[i] &lt;- mean(sample(sites$value$TR, nrow(sites$value), replace = TRUE))
  }
  }
  </code></pre>
  
  <p>But this just returns </p>
  
  <pre><code>list()
  </code></pre>
  
  <p>Ideally I'd like a data frame with meanTraps for each site.
  Can anyone help correct my error?</p>