Using independence_test in R with unequal sample sizes This is a homework problem that I have where I'm testing the means of sampled high temperatures in two cities:  Des Moines and Chicago.  The first part of the question required me to run an unpaired t-test which I was able to do.  
The second part asked me to use a permutation test on the same data.  Unfortunately, there are unequal sample sizes (Des Moines:  9, Chicago:  8) and I get an error when I use the independence_test in the coin package in R. 
A similar question on this site mentioned that it should be easy to code this comparison using this package but went on to write longer code that did the calculations itself.  I can adapt that code, but I was curious if there's a shorter way to code it in the independence_test within the coin package.  Here's what I have and the error I get:
> desmoines<-c(83,91,94,89,89,96,91,92,90)
> chicago<-c(78,82,81,77,79,81,80,81)
> library(coin)
> independence_test(desmoines~chicago)
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 8, 9

 A: Comment: Perhaps you can explain why you're doing an independence test, especially with two data vectors of different length. 

Are some of the data from one city from the same years as from the other city? What 'linkage' between cities makes you ask about independence? The correlation between Chi and the first 8 elements in Des is about 0.7:  the statement cor(c,d[1:8]) returns 0.6939698, but that's largely due to the one point $(83,78).$

Without knowing more of the story, my first impulse was to do a Welch
2-sample t test. I indulged this impulse--perhaps without due deliberation--and the test rejects the null hypothesis of equal population means with a tiny P-value (5.298e-06). 
Also, box plots on the same scale
pretty clearly show that the two cities differ greatly in whatever
measure you are using here. The data for the two cities are 
completely separated by the value 82.5 (red line).

If this is not helpful, then please tell us what you're really trying
to find out and maybe someone will answer.
