Rgbif unknown or uninitialized column warning

Hello! I have a small question regarding rgbif keys and a warning I am receiving when searching for a taxon/genus key:

Warning message:
Unknown or uninitialised column: genusKey.

I have already found a solution, but don’t understand the reasoning.

I am looking up the keys for different genera and initially all was fine:

> name_backbone("Acer")$genusKey
[1] 3189834
> name_backbone("Picea")$genusKey
[1] 7606064

However, doing the same for “Pinus” results in the warning:

> name_backbone("Pinus")$genusKey
NULL
Warning message:
Unknown or uninitialised column: `genusKey`. 

I also receive the warning when using taxonKey and usageKey.

However, it seems to work if I use “Pinus L.”:

> name_backbone("Pinus L.")$genusKey
[1] 2684241

So I guess my question is why would this be the case for only Pinus among these three genera?

Thanks!

Hi – It looks like name_backbone("Pinus") doesn’t actually return a matching taxon – here’s what does come back:

> test_pinus <- name_backbone("Pinus")
> test_pinus
# A tibble: 1 × 4
#   confidence matchType synonym verbatim_name
# *      <int> <chr>     <lgl>   <chr>        
# 1        100 NONE      FALSE   Pinus

The dataframe that’s returned doesn’t include a genusKey column, so you get the “Unknown…” error when trying to view that non-existent column. You do get a maybe-helpful matchType column – e.g., before trying to pull a genusKey, you might want to check matchType’s value:

test_pinus <- name_backbone("Pinus")
if (test_pinus$matchType != "NONE") {...}

That said, I’m not sure why “Pinus” wouldn’t return a similar result to your “Acer” search, but if you need to avoid that ‘no match’ situation in your script (where the author isn’t known or isn’t part of the input), checking the returned dataframe’s matchType, &/or specifying rank or genus options along with name might help – e.g.:

name_backbone(name = "Pinus", genus = "Pinus")

Also not sure exactly why that works & other setup’s don’t, but maybe more info at “Lookup names in the GBIF backbone taxonomy. — name_backbone • rgbif” & all ears if other suggestions come up

1 Like

@jakeamahr

Have a look at this article: (relevant section pasted below)

Too many choices problem

When two or more names exist in the GBIF Backbone Taxonomy that have the same name but different authorship (homotypic synonyms), supplying just the binomial name will result in matchType : "HIGHERRANK".

For example, the binomial name “Glocianus punctiger” has two entries in the backbone taxonomy. Using the verbose=TRUE will return both names.

name_backbone("Glocianus punctiger",verbose=TRUE) # returns more names
# "Glocianus punctiger (C.R.Sahlberg, 1835)"
# "Glocianus punctiger (Gyllenhal, 1837)"

However, giving just the binomial name will return the genus Glocianus, since GBIF doesn’t know which one to choose.

name_backbone("Glocianus punctiger") # matchType : "HIGHERRANK"

Since name_backbone is designed to give back the best match, it’s not possible for the response to choose between the two names.

2 Likes

Thanks @jwaller ! Seems there is a mollusk in a now-defunct Pinus genus I was very unaware of. In the end I just downloaded a larger subset of the data for the location I was interested (it was very small) and then filtered within R by genus, but was curious what was happening on the gbif side of things with the name_backbones.

1 Like