title: subsetting on a factor column parsed by readHTMLTable return no result
body: <p>I ran into a weird subsetting problem. The problem is that I can subset one column but I cannot subset the other. Both columns seemed to have been parsed by readHTMLTable the same way.</p>
  
  <p>The code to replicate</p>
  
  <pre><code>require(XML)
  theurl &lt;- "http://en.wikipedia.org/wiki/List_of_stock_exchanges"
  html &lt;- htmlParse(theurl)
  seData &lt;- readHTMLTable(html)[[2]]
  names(seData) = c("Rank","EX","Economy","HQ","MarketCap","TradeValue")
  seData = transform(seData,MarketCap = as.numeric(gsub(",","",MarketCap)))
  seData = transform(seData,TradeValue = as.numeric(gsub(",","",TradeValue)))
  </code></pre>
  
  <p>I want to subset for Indian Stock Exchange, so I used:</p>
  
  <pre><code>&gt; subset(seData,seData$Economy == "India")
  [1] Rank       EX         Economy    HQ         MarketCap  TradeValue
  &lt;0 rows&gt; (or 0-length row.names)
  &gt; subset(seData,seData$Economy == " India")
  [1] Rank       EX         Economy    HQ         MarketCap  TradeValue
  &lt;0 rows&gt; (or 0-length row.names)
  </code></pre>
  
  <p>I don't get any rows back, despite having validated that there are two rows that should satisfy the condition, but I can easily do the same thing to the other column "EX":</p>
  
  <pre><code>&gt; subset(seData,seData$EX == "JSE Limited")
     Rank          EX      Economy           HQ MarketCap TradeValue
  17   17 JSE Limited  SouthAfrica Johannesburg       903        287
  </code></pre>
  
  <p>I've ran other functions and the two columns look exactly the same..</p>
  
  <pre><code>&gt; sapply(seData,class)
        Rank         EX    Economy         HQ  MarketCap TradeValue 
    "factor"   "factor"   "factor"   "factor"  "numeric"  "numeric" 
  &gt; levels(seData$Economy)
   [1] " Australia"             " Brazil"                " Canada"               
   [4] " China"                 " Germany"               " Hong Kong"            
   [7] " India"                 " Japan"                 " Russia"               
  ...
  &gt; levels(seData$EX)
   [1] "Australian Securities Exchange"   "BME Spanish Exchanges"           
   [3] "BM&amp;F Bovespa"                     "Bombay Stock Exchange"           
   [5] "Deutsche BÃ¶rse"                  "Hong Kong Stock Exchange"        
   [7] "JSE Limited"                      "Korea Exchange"                  
   ...    
  </code></pre>
  
  <p>What did I miss? What is wrong with the subsetting command I used? :( </p>
  
  <pre><code>subset(seData,seData$Economy == " India")
  </code></pre>