ropensci / rfishbase

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

`Species` entry from `load_data` contains `Genus + species` #269

Closed DanOvando closed 1 year ago

DanOvando commented 1 year ago
Session Info ```r ─ Session info ───────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.3.1 (2023-06-16) os macOS Ventura 13.4.1 system aarch64, darwin20 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/Los_Angeles date 2023-07-20 rstudio 2023.06.1+524 Mountain Hydrangea (desktop) pandoc 3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) ─ Packages ───────────────────────────────────────────────────────────────────────────────────────── package * version date (UTC) lib source askpass 1.1 2019-01-13 [1] CRAN (R 4.3.0) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) callr 3.7.3 2022-11-02 [1] CRAN (R 4.3.0) cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.0) codetools 0.2-19 2023-02-01 [1] CRAN (R 4.3.1) colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0) contentid 0.0.17 2023-04-21 [1] CRAN (R 4.3.0) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.0) DBI 1.1.3 2022-06-18 [1] CRAN (R 4.3.0) dbplyr 2.3.3 2023-07-07 [1] CRAN (R 4.3.0) devtools 2.4.5 2022-10-11 [1] CRAN (R 4.3.0) digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.0) doParallel 1.0.17 2022-02-07 [1] CRAN (R 4.3.0) dplyr 1.1.2 2023-04-20 [1] CRAN (R 4.3.0) duckdb 0.8.1 2023-06-16 [1] CRAN (R 4.3.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) evaluate 0.21 2023-05-05 [1] CRAN (R 4.3.0) expm 0.999-7 2023-01-09 [1] CRAN (R 4.3.0) fansi 1.0.4 2023-01-22 [1] CRAN (R 4.3.0) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) foreach 1.5.2 2022-02-02 [1] CRAN (R 4.3.0) fs 1.6.2 2023-04-25 [1] CRAN (R 4.3.0) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) ggplot2 3.4.2 2023-04-03 [1] CRAN (R 4.3.0) glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.0) gtable 0.3.3 2023-03-21 [1] CRAN (R 4.3.0) hms 1.1.3 2023-03-21 [1] CRAN (R 4.3.0) htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.3.0) htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.0) httpuv 1.6.11 2023-05-11 [1] CRAN (R 4.3.0) httr 1.4.6 2023-05-08 [1] CRAN (R 4.3.0) iterators 1.0.14 2022-02-05 [1] CRAN (R 4.3.0) jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.0) knitr 1.43 2023-05-25 [1] CRAN (R 4.3.0) later 1.3.1 2023-05-02 [1] CRAN (R 4.3.0) lattice 0.21-8 2023-04-05 [1] CRAN (R 4.3.1) lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) marlin 0.4.0 2023-07-20 [1] local Matrix 1.6-0 2023-07-08 [1] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0) openssl 2.1.0 2023-07-15 [1] CRAN (R 4.3.0) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.2 2023-06-26 [1] CRAN (R 4.3.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgload 1.3.2.1 2023-07-08 [1] CRAN (R 4.3.0) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.3.0) processx 3.8.2 2023-06-30 [1] CRAN (R 4.3.0) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) progress 1.2.2 2019-05-16 [1] CRAN (R 4.3.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.3.0) ps 1.7.5 2023-04-18 [1] CRAN (R 4.3.0) purrr 1.0.1 2023-01-10 [1] CRAN (R 4.3.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.0) RcppEigen 0.3.3.9.3 2022-11-05 [1] CRAN (R 4.3.0) readr 2.1.4 2023-02-10 [1] CRAN (R 4.3.0) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.3.0) rfishbase * 4.1.2 2023-06-02 [1] CRAN (R 4.3.0) rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.0) rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.0) rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0) scales 1.2.1 2022-08-20 [1] CRAN (R 4.3.0) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) shiny 1.7.4.1 2023-07-06 [1] CRAN (R 4.3.0) stringi 1.7.12 2023-01-11 [1] CRAN (R 4.3.0) stringr 1.5.0 2022-12-02 [1] CRAN (R 4.3.0) tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.3.0) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis 2.2.2 2023-07-06 [1] CRAN (R 4.3.0) utf8 1.2.3 2023-01-31 [1] CRAN (R 4.3.0) vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.0) withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.0) xfun 0.39 2023-04-20 [1] CRAN (R 4.3.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) yaml 2.3.7 2023-01-23 [1] CRAN (R 4.3.0) [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library ```

It seems as though the Species entry of the results of load_taxa now contains both the genus and species, as opposed to just the species. See the reprex below.

Not sure if this is intended but given the format of the table it seems somewhat confusing (i.e. the Genus entry contains Genus, the Family contains the Family, so I would expect Species to contain just the species). I would expect maybe a column called ScientificName or something like that be Genus + species?

If this is intentional that's fine, but I don't believe this is how load_data used to operate so flagging it in case it is a bug

library(rfishbase)

packageVersion("rfishbase")
#> [1] '4.1.2'

db <- rfishbase::load_taxa()
#> Joining with `by = join_by(Subfamily, GenCode, FamCode)`
#> Joining with `by = join_by(FamCode)`
#> Joining with `by = join_by(Order, Ordnum, Class, ClassNum)`
#> Joining with `by = join_by(Class, ClassNum)`

head(db)
#> # A tibble: 6 × 8
#>   SpecCode Species                Genus  Subfamily Family Order Class SuperClass
#>      <int> <chr>                  <chr>  <chr>     <chr>  <chr> <chr> <chr>     
#> 1    24523 Aborichthys kempi      Abori… <NA>      Nemac… Cypr… Tele… Osteichth…
#> 2    65802 Aborichthys rosammai   Abori… <NA>      Nemac… Cypr… Tele… Osteichth…
#> 3    24524 Aborichthys tikaderi   Abori… <NA>      Nemac… Cypr… Tele… Osteichth…
#> 4    67300 Aborichthys verticauda Abori… <NA>      Nemac… Cypr… Tele… Osteichth…
#> 5    67609 Aborichthys waikhomi   Abori… <NA>      Nemac… Cypr… Tele… Osteichth…
#> 6      268 Abramis brama          Abram… Leucisci… Leuci… Cypr… Tele… Osteichth…

Created on 2023-07-20 with reprex v2.0.2

DanOvando commented 1 year ago

Nevermind, seems consistent with how Taxize is doing things