title: Input data must have class mids
body: <p>I'm working on a school project where I need to impute missing data and after the imputation with mice I'm trying to produce completed data sets with the complete-function. </p>
  
  <p>When I run them one by one everything works fine, but I'd like to use a for-loop in case I want to have more than just <code>m = 5</code> imputations. Now, when trying to run the <code>for-loop</code>, I always get the error </p>
  
  <blockquote>
    <p>Error in complete(imputation[1]) : Input data must have class 'mids'.</p>
  </blockquote>
  
  <p>However when I look up the class it <strong>is</strong> mids, what's going wrong here?</p>
  
  <p>This is my code:</p>
  
  <pre><code>imputation &lt;- mice(data = data, m = 5, method = "norm", maxit = 1, seed = 500) 
  m &lt;- 5
  for(i in 1:m){
    completeData[m] &lt;- complete(imputation[m])
    print(summary(completeData[m]))
  }
  </code></pre>
  
  <p>Could someone maybe help me out here? </p>