title: WGCNA package: value matching function output contains wrong NAs
body: <p>I use WGCNA package for analyzing the co-expressed genes. Here I try to Form a data frame analogous to expression data that will hold the clinical traits. and i use the following codes:</p>
  <p>table for traitData  
  <p>| x  | sample    | NoduleperPlant    |
  <p>|-   |-  |-  |
  <p>| 1  | 1021_verbena_rep_1    | 2     |
  <p>| 2  | 1021_verbena_rep_2    | 3     |
  <p>| 3  | 1021_verbena_rep_3    | 1     |
  <p>| 4  | 1021_camporegio_rep_1     | 2     |
  <p>| 5  | 1021_camporegio_rep_2     | 3     |
  <p>| 6  | 1021_camporegio_rep_3     | 4     |
  <p>| 7  | BL225C_camporegio_rep_1   | 5     |
  <p>| 8  | BL225C_camporegio_rep_2   | 4     |
  <p>| 9  | BL225C_camporegio_rep_3   | 1     |
  <p>Table  dfxpr (some of the genes are presented in table)
  <p>|FIELD1                 |aacC-1|aacC4-1|aapJ-1|aapM-1|aapP-1|aapQ-1|aarF-1|
  <p>|-----------------------|------|-------|------|------|------|------|------|
  <p>|X1021_verbena_rep_1    |42    |46     |12412 |935   |3354  |2876  |550   |
  <p>|X1021_verbena_rep_2    |52    |37     |11775 |946   |2970  |2824  |514   |
  <p>|X1021_verbena_rep_3    |12    |22     |5077  |397   |1462  |1228  |230   |
  <p>|X1021_camporegio_rep_1 |52    |71     |12983 |1454  |3408  |3248  |707   |
  <p>|X1021_camporegio_rep_2 |20    |65     |9240  |803   |2807  |3146  |445   |
  <p>|X1021_camporegio_rep_3 |28    |53     |11030 |1065  |3480  |3410  |582   |
  <p>|BL225C_camporegio_rep_1|29    |19     |6346  |375   |938   |768   |118   |
  <p>|BL225C_camporegio_rep_2|51    |62     |12938 |781   |1765  |1629  |291   |
  <p>|BL225C_camporegio_rep_3|52    |43     |6462  |504   |1120  |1091  |238   |
     
  <pre><code>traitData = read.csv(&quot;NodulPerPlantTraitForLowGroup.csv&quot;); #this csv file contains 3 columns as the first column is non-relevant information, second column contains the names of samples and the third column holds the values measured for the traits. 
      # remove columns that hold information I do not need.
      allTraits = traitData[, -1];
      allTraits = allTraits[, 1:2];
      # Form a data frame analogous to expression data that will hold the clinical traits.
      lowNoduleSamples = rownames(dfxpr) #dfxpr is a data frame containing 9 observations (i.e. samples) and 6398 variables (i.e. genes)
      traitRows = match(lowNoduleSamples, allTraits$sample); #here is the line i get wrong values as NAs while i know they all should match
      datTraits = allTraits[traitRows, -1]; #then this lines result NAs too
      rownames(datTraits) = allTraits[traitRows, 1];
      collectGarbage();
  </code></pre>
  <p>how can I fix the problem?</p>