You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a non-bug issue that's been popping up for me just enough to be a drag. For knotted-up workflow reasons I do a round of resolve_sci_taxa() and then from a list of the non-hits treat replace_taxa() like this:
repl_list <- list(
# 'Abies balsamea var phanerolepis' = 'Abies x phanerolepis',
# 'Acer freemanii' = 'Acer x freemanii',
'Acer x freemanii' = 'Acer x freemanii',
'ACER PLATANOIDES SCHWEDLERI' = 'Acer platanoides',
# 'Acer tataricum ginnala' = 'Acer tataricum',
# 'Alnus rugosa' = 'Alnus incana',
# 'Amelanchier grandifolia' = 'Amelanchier x grandiflora',
'Amelanchier X grandiflora' = 'Amelanchier x grandiflora',
'AMELANCHIER X GRANDIFLORA ROBIN HILL' = 'Amelanchier x grandiflora',
'Carya tomentosa' = 'Carya alba',
'Cladrastus lutea' = 'Cladrastis kentukea',
'Gleditsia triacanthos inermis' = 'Gleditsia triacanthos',
'Laburnum x watereri' = 'Laburnum x watereri'
# 'Laburnum_x_watereri' = 'Laburnum x watereri',
)
map2(names(repl_list), repl_list, function(bad, good) {
replace_taxa(path = map_path, input = bad, output = good)
return()})
If it works map2() returns "[[#]] NULL" for each entry. A lot of the particulars here involve fighting with either ITIS or the next stage of vetting I have to do -- like the entries where I'm replacing a taxon with itself. Some are commented out because this list has been accumulating with irregular repeats from one data file to the next, so it's good to build this "dictionary". So most of the weirdness here is not TCR issues.
But a problem is that the matching in replace_taxa() is fairly picky, and so won't match "ACER" with "Acer", for instance. It might be helpful and safe (in all functions?) to treat every input taxon as though it were properly capitalized, like "Genus species" -- or at least to do case-insensitive matching.
For what I need I can handle this upstream with a conversion to proper case on reading the file -- but it's not always clear that I'm going to have to so I get halfway through, discover it and have to go back.
The text was updated successfully, but these errors were encountered:
Here's a non-bug issue that's been popping up for me just enough to be a drag. For knotted-up workflow reasons I do a round of
resolve_sci_taxa()
and then from a list of the non-hits treatreplace_taxa()
like this:If it works
map2()
returns "[[#]] NULL" for each entry. A lot of the particulars here involve fighting with either ITIS or the next stage of vetting I have to do -- like the entries where I'm replacing a taxon with itself. Some are commented out because this list has been accumulating with irregular repeats from one data file to the next, so it's good to build this "dictionary". So most of the weirdness here is not TCR issues.But a problem is that the matching in
replace_taxa()
is fairly picky, and so won't match "ACER" with "Acer", for instance. It might be helpful and safe (in all functions?) to treat every input taxon as though it were properly capitalized, like "Genus species" -- or at least to do case-insensitive matching.For what I need I can handle this upstream with a conversion to proper case on reading the file -- but it's not always clear that I'm going to have to so I get halfway through, discover it and have to go back.
The text was updated successfully, but these errors were encountered: