title: Comparing two lists [R]
body: <p>I have two rather long lists (both are 232000 rows).  When trying to run analyses using both, R is giving me an error that some elements in one lists are not in the other (for a particular code to run, both lists need to be exactly the same).  I have done the following to try and decipher this:</p>
  
  <pre><code>#In Both
  both &lt;- varss %in% varsg
  length(both)
  
  #What is in Both
  int &lt;- intersect(varss,varsg)
  length(int)
  
  #What is different in varss
  difs &lt;- setdiff(varss,varsg)
  length(difs)
  
  #What is different in varsg
  difg &lt;- setdiff(varsg,varss)
  length(difg)
  </code></pre>
  
  <p>I think I have the code right, but my problem is that the results from the code above are not yielding what I need.  For instance, for <code>both &lt;- varss %in% varsg</code> I only get a single <code>FALSE</code>.  Do both my lists need to be in a specific class in order for this to work?  I've tried <code>data.frame</code>, <code>list</code> and <code>character</code>.  Not sure whether anything major like a <code>function</code> needs to be applied.</p>
  
  <p>Just to give a little bit more information about my lists, both are a list of SNP names (genetic data)</p>
  
  <p>Edit:</p>
  
  <p>I have loaded these two files as <code>readRDS()</code> and not sure whether this might be causing some problems.  When trying to just use <code>varss[1:10,]</code> i get the following info:</p>
  
  <pre><code> [1] rs41531144 rs41323649 exm2263307 rs41528348 exm2216184 rs3901846 
   [7] exm2216185 exm2216186 exm2216191 exm2216198
  232334 Levels: exm1000006 exm1000025 exm1000032 exm1000038 ... rs9990343
  </code></pre>
  
  <p>I have little experience with <code>RData</code> files, so not sure whether this is a problem or not...</p>
  
  <p>Same happens with using <code>varsg[1:10,]</code> :</p>
  
  <pre><code> [1] exm2268640 exm41      exm1916089 exm44      exm46      exm47     
   [7] exm51      exm53      exm55      exm56     
  232334 Levels: exm1000006 exm1000025 exm1000032 exm1000038 ... rs999943 
  </code></pre>