title: Wilcox.test in R - not enough x observations
body: <p>I'm new to R and trying to perform a wilcox.test on water quality data. My data is long form and I've subset the data to create "preWWTF" and "postWWTF" to group data before or after an upstream wastewater treatment facility upgrade. The code I'm using is: </p>
  
  <pre><code>wilcox.test(x=preWWTF$Result [preWWTF$Loc_Analyte=="BarkTop_DP"],
          y=postWWTF$Result [postWWTF$Loc_Analyte=="BarkTop_DP"],
          paired = FALSE)
  </code></pre>
  
  <p>I get the error "not enough (finite) 'x' observations". There are no NA or blank values. However, preWWTF has fewer observations than postWWTF. Is there some code language I can use to 'truncate' the post WWTF data so there are the same number of observations pre vs. post? I assume that is what is causing the issue. Thanks. </p>