ropensci / rfishbase

R interface to the fishbase.org database
https://docs.ropensci.org/rfishbase
111 stars 40 forks source link

common_to_sci in spanish #210

Closed ACalleros closed 3 years ago

ACalleros commented 3 years ago

Hi, I have this table and I want to get the scientific names from common names in spanish with:

common_to_sci(pesca$especie, Language = 'Spanish')

`

especie estado
Abulón Baja California
Almeja Baja California
Anchoveta Baja California
Atún Baja California
Bagre Baja California
Baqueta Baja California
`

This is the resulting table with names in english. It seems that it is ignoring the language argument.

`

Species ComName Language SpecCode
Engraulis ringens Anchoveta English 4
Cetengraulis mysticetus Anchoveta English 548
Engraulis ringens Anchoveta(=Peruvian anchovy) English 4
Cetengraulis edentulus Atlantic Anchoveta English 547
Cetengraulis edentulus Atlantic anchoveta English 547
Cetengraulis mysticetus Pacific anchoveta English 548
`

cboettig commented 3 years ago

Thanks for the report! Sorry about that and I'll try and take a look soon

ACalleros commented 3 years ago

Thanks, @cboettig! Sorry for the pressure, but I'm stuck with my thesis and this is the only part that's holding me down

cboettig commented 3 years ago

Sorry @ACalleros , I'm locked down in other stuff, but meanwhile it's not too hard to bypass the current interface and grab this data (at least with the 2019 version we provide).

When you first import a table, e.g. common_names(), you should see a message referring to the raw table, like this:

library(tidyverse)
library(rfishbase)
> common <- common_names()
Importing /home/cboettig/.local/share/R/rfishbase/comnames_fb_1904.tsv.bz2 in 50000 line chunks:
[\] chunk 7 ...Done! (in 20.62483 secs)

this tells us that the data in that function is coming from the comnames table from April 2019 -- (We're overdue for a new release, sorry! hopefully later this summer -- we're an all volunteer effort and not directly supported by FishBase).

You can read that table in directly:

common <- readr::read_tsv("/home/cboettig/.local/share/R/rfishbase/comnames_fb_1904.tsv.bz2")

and should be good to go. (The path for you will be different of course, instead of /home/cboettig/.... You can see the root path to all the fishbase tables on your machine with: tools:R_user_dir("rfishbase") )

HTH!