title: Anesrake run error when executing multiple target variables
body: <p>I currently am trying to execute the anesrake function (part of the anesrake package <a href="https://cran.r-project.org/web/packages/anesrake/index.html" rel="nofollow">https://cran.r-project.org/web/packages/anesrake/index.html</a> which weights population attribute sets based on sample attribute sets) within R to approximate weight rankings for multiple sets of variables.</p>
  
  <p>I have a table of sample data testData:</p>
  
  <pre><code>Index   GENDER   AGE    
  1       Female   18-24  
  2       Female   35-64  
  3       Male     65+    
  </code></pre>
  
  <p>Note: age range has 6 levels- 18-24,25-34,35-44,45-54,55-64,65+</p>
  
  <p>I then have a set of 2 lists for my population data:</p>
  
  <pre><code>GENDER &lt;- c(.49,.51)
  AGE &lt;- c(.08,.1,.12,.2,.2,.3)
  </code></pre>
  
  <p>I then create a set of target variables and a CASEID column on the original table:</p>
  
  <pre><code>targets &lt;- list(GENDER, AGE)
  names(targets) &lt;- c("GENDER", "AGE")
  testData$CASEID &lt;- 1:length(testData$GENDER)
  </code></pre>
  
  <p>I finally get to see the variance in my population data vs my sample data:</p>
  
  <pre><code>&gt; anesrakefinder(targets, testData, choosemethod = "total")
     GENDER       AGE 
  0.1495337 0.3668394 
  </code></pre>
  
  <p>But when I use the anesrake function to do the final analysis, I get thrown errors:</p>
  
  <pre><code>&gt; anesrake(inputter=targets,dataframe=testData,caseid=testData$CASEID)
  Error in rakeonvar.default(mat[, i], inputter[[i]], weightvec) : 
    number of variable levels does not match number of weighting levels
  In addition: Warning message:
  In rakeonvar.default(mat[, i], inputter[[i]], weightvec) :
    NAs introduced by coercion
  </code></pre>
  
  <p>I've been following two 'tutorials' on how to utilize anesrake but I'm still coming up short. These are the tutorials below:</p>
  
  <p><a href="http://SDAZA" rel="nofollow">http://sdaza.com/survey/2012/08/25/raking/</a></p>
  
  <p><a href="http://SI">http://surveyinsights.org/wp-content/uploads/2014/07/Full-anesrake-paper.pdf</a></p>
  
  <p>Any help that you could provide on this would be greatly, greatly appreciated.</p>
  
  <p>Cheers,</p>
  
  <p>Stu</p>