title: pull occurrences for species with multiple taxon IDs in R OBIS
body: <p>I'm using R OBIS (robis package) to pull occurrences of a bunch of species. Importantly, I only have the scientific name of species.</p>
  <p>The problem is, some species have multiple taxon IDs in OBIS. For example, Ceramium virgatum, a red algae, has 2 IDs in OBIS:</p>
  <ul>
  <li>Ceramium virgatum, JD Hooker &amp; Harvey, 1848, taxon ID: 377258</li>
  <li>Ceramium virgatum, Roth 1797, taxon ID: 178915</li>
  </ul>
  <p>When I use the <code>occurrence(scientificname = &quot;Ceramium virgatum&quot;)</code> command using the species name as the identifier, I get only occurrences of the first ID (377258), which, in this case, only has 4 occurrence records.</p>
  <p>I can manually pull <code>occurrence(taxonid = 178915)</code> to get occurrences of the other ID, which returns a dataset with the same value in the scientificName column, but I wouldn't have known this existed if I didn't manually look at the OBIS map explorer (<a href="https://mapper.obis.org/?taxonid=377258,178915" rel="nofollow noreferrer">https://mapper.obis.org/?taxonid=377258,178915</a>).</p>
  <p>How can I programatically make sure that I get all occurrences in the case that OBIS has multiple entries for more species in my list?</p>
  <pre><code>library(robis)
  library(dplyr)
  
  
  # the Problem: Ceramium virgatum has 2 taxonIDs in obis - 377258 and 178915,
  # but when calling only by Sci Name, robis only returns records from one of these IDs
  
  # using occurrence() by sci name alone, it  pulls 4 records from the first ID, and omits second ID
  occurrence(scientificname = &quot;Ceramium virgatum&quot;) %&gt;% 
    summarize(n_records = n(), 
              id = unique(aphiaID),
              scientificName = unique(scientificName)) 
  #   n_records     id
  #     &lt;int&gt;      &lt;int&gt;
  #       4        377258
    
  
  # using occurrence() by ID #2, it only pulls 15872 records from the second ID
  occurrence(taxonid = 178915) %&gt;%
    summarize(n_records = n(), 
              id = unique(aphiaID),
              scientificName = unique(scientificName)) 
  #   n_records     id        scientificName   
  #    &lt;int&gt;       &lt;int&gt;           &lt;chr&gt;            
  #    15872       178915     Ceramium virgatum
  
  
  # I can pull all records by calling both ID names (and they return same sci name),
  # but for the rest of my species, I only have scientific names, not individual OBIS IDs. 
  occurrence(taxonid = c(377258,178915)) %&gt;%
    group_by(aphiaID) %&gt;%
    summarize(n_records = n(), 
              id = unique(aphiaID),
              scientificName = unique(scientificName)) 
  #   aphiaID     n_records     id         scientificName   
  #   &lt;int&gt;         &lt;int&gt;      &lt;int&gt;          &lt;chr&gt;            
  #     178915     15872       178915     Ceramium virgatum
  #     377258         4       377258     Ceramium virgatum
  </code></pre>