text: user2482: I have downloaded two datasets, and I am trying to remove the genes they do not share in common.  Is there a biocmanager package with a function that can compare their gene ids, match them and reorder them?
  
  user73: Assuming the datasets are arranged in matrices with one gene per row, this can be done by intersecting row names:
  commonNames <- sort(intersect(rownames(data1.mat), rownames(data2.mat)));
  filtered.data1.mat <- data1.mat[commonNames,];
  filtered.data2.mat <- data2.mat[commonNames,];
  
  It would be helpful if you could provide more information about your datasets. There are many other ways to do this, and the way that works best for you will depend on your particular situation.
  
original_text: 2482: <p>I have downloaded two datasets, and I am trying to remove the genes they do not share in common.  Is there a biocmanager package with a function that can compare their gene ids, match them and reorder them?</p>
   73: <p>Assuming the datasets are arranged in matrices with one gene per row, this can be done by intersecting row names:</p>
  <pre><code>commonNames &lt;- sort(intersect(rownames(data1.mat), rownames(data2.mat)));
  filtered.data1.mat &lt;- data1.mat[commonNames,];
  filtered.data2.mat &lt;- data2.mat[commonNames,];
  </code></pre>
  <p>It would be helpful if you could provide more information about your datasets. There are many other ways to do this, and the way that works best for you will depend on your particular situation.</p>
  