rfishbase

R interface to the fishbase.org database

https://github.com/ropensci/rfishbase

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 18 committers (11.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

fish fishbase r r-package rstats taxonomy

Keywords from Contributors

genome taxize geocode weather-data metagenomics biodiversity nomenclature darwincore biology sequenced-genomes
Last synced: 6 months ago · JSON representation

Repository

R interface to the fishbase.org database

Basic Info
Statistics
  • Stars: 120
  • Watchers: 20
  • Forks: 42
  • Open Issues: 37
  • Releases: 12
Topics
fish fishbase r r-package rstats taxonomy
Created over 14 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing Codemeta

README.Rmd

---
output: github_document
---

# rfishbase 



[![R-CMD-check](https://github.com/ropensci/rfishbase/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/rfishbase/actions/workflows/R-CMD-check.yaml)
[![Coverage status](https://codecov.io/gh/ropensci/rfishbase/branch/master/graph/badge.svg)](https://app.codecov.io/github/ropensci/rfishbase?branch=master)
[![Onboarding](https://badges.ropensci.org/137_status.svg)](https://github.com/ropensci/software-review/issues/137)
[![CRAN status](https://www.r-pkg.org/badges/version/rfishbase)](https://cran.r-project.org/package=rfishbase)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/rfishbase)](https://github.com/r-hub/cranlogs.app)


Welcome to `rfishbase 5`! This is the fourth rewrite of the original `rfishbase` package described in [Boettiger et al. (2012)](https://doi.org/10.1111/j.1095-8649.2012.03464.x).   


Another streamlined re-design following new abilities for data hosting and access.
This release relies on a HuggingFace datasets hosting for data and metadata hosting
in parquet and schema.org.  

Data access is simplified to use the simple HuggingFace datasets API instead
of the previous contentid-based resolution. This allows metadata to be defined
with directly alongside the data platform independent of the R package.  

A simplified access protocol relies on `duckdbfs` for direct reads of tables.
Several functions previously used only to manage connections are now deprecated
or removed, along with a significant number of dependencies.

Core use still centers around the same package API using the `fb_tbl()` function,
with legacy helper functions for common tables like `species()` are still accessible and
can still optionally filter by species name where appropriate.  As before, loading the
full tables and sub-setting manually is still recommended.

Historic helper  functions like `load_taxa()` (combining the taxonomic classification from Species,
Genus, Family and Order tables), `validate_names()`, and `common_to_sci()` and 
`sci_to_common()` should be in working order, all using table-based outputs.


- `rfishbase 1.0` relied on parsing of XML pages served directly from Fishbase.org.  
- `rfishbase 2.0` relied on calls to a ruby-based API, `fishbaseapi`, that provided access to SQL snapshots of about 20 of the more popular tables in FishBase or SeaLifeBase.
- `rfishbase 3.0` side-stepped the API by making queries which directly downloaded compressed csv tables from a static web host. This substantially improved performance a reliability, particularly for large queries. The release largely remained backwards compatible with 2.0, and added more tables.
- `rfishbase 4.0` extends the static model and interface. Static tables are distributed in parquet and accessed through a provenance-based identifier. While old functions are retained, a new interface is introduced to provide easy access to all fishbase tables.

We welcome any feedback, issues or questions that users may encounter through our issues tracker on GitHub: 




```{r include=FALSE}
knitr::opts_chunk$set(warning=FALSE, comment=NA)
options("rfishbase_local_db" = FALSE)

```


## Installation



```{r message=FALSE, warning=FALSE, results="hide", eval=FALSE}
remotes::install_github("ropensci/rfishbase")
```


```{r message=FALSE, warning=FALSE, results="hide"}
library("rfishbase")
library("dplyr") # convenient but not required
```

## Getting started

## Generic table interface

All fishbase tables can be accessed by name using the `fb_tbl()` function:

```{r}
fb_tbl("ecosystem")
```


You can see all the tables using `fb_tables()` to see a list of all the table names (specify `sealifebase` if desired). Careful, there are a lot of them! The fishbase databases have grown a lot in the decades, and were not intended to be used directly by most end-users, so you may have considerable work to determine what's what. Keep in mind that many variables can be estimated in different ways (e.g. trophic level), and thus may report different values in different tables.  Also note that species is name (or SpecCode) is not always the primary key for a table -- many tables are specific to stocks or even individual samples, and some tables are reference lists that are not species focused at all, but meant to be joined to other tables (`faoareas`, etc).  Compare tables against what you see on fishbase.org, or ask on our issues forum for advice!


```{r}
fish <- c("Oreochromis niloticus", "Salmo trutta")

fb_tbl("species") %>% 
  mutate(sci_name = paste(Genus, Species)) %>%
  filter(sci_name %in% fish) %>% 
  select(sci_name, FBname, Length)

```

In most tables, species are identified by `SpecCode` (as per best practices) rather than scientific names.  Multiple tables can be joined on the `SpecCode` to more fully describe a species.  

To filter species by taxonomic names, use the taxa table from `load_taxa()`, which provides a joined table of taxonomy from subspecies up through Class, along with the corresponding FishBase taxon ids codes.  Here is an example workflow joining two of the spawning tables and filtering to the grouper family, _Epinephelidae_:

```{r  message=FALSE}
library(rfishbase)
library(dplyr)

## Get the whole spawning and spawn agg table, joined together:
spawn <- left_join(fb_tbl("spawning"),  
                   fb_tbl("spawnagg"), 
                   relationship = "many-to-many")

# Filter taxa down to the desired species
groupers <- load_taxa() |> filter(Family == "Epinephelidae")

## A "filtering join" (inner join) 
spawn |> inner_join(groupers)
```

## Species Names

Always keep in mind that taxonomy is a dynamic concept. Species can be split or lumped based on new evidence, and naming authorities can disagree over which name is an 'accepted name' or 'synonym' for any given species. When providing your own list of species names, consider first checking that those names are "valid" in the current taxonomy established by FishBase:

```{r message=FALSE}
validate_names("Abramites ternetzi")
```

`rfishbase` can also provide tables of `synonyms()`, a table of `common_names()` in multiple languages, and convert `common_to_sci()` or `sci_to_common()`

```{r message=FALSE}
common_to_sci(c("Bicolor cleaner wrasse", "humphead parrotfish"), Language="English")
```

Note that the results are returned as a table, potentially indicating other common names for the same species, as well as potentially different species that match the provided common name! Please always be careful with names, and use unique SpecCodes to refer to unique species.  


## SeaLifeBase

SeaLifeBase.org is maintained by the same organization and largely parallels the database structure of Fishbase. As such, almost all `rfishbase` functions can instead be instructed to address the 


```{r}
fb_tbl("species", "sealifebase")
```

## Versions and importing all tables

By default, tables are downloaded the first time they are used.  `rfishbase` defaults to download the latest available snapshot; be aware that the most recent snapshot may be months behind the latest data on fishbase.org. Check available releases:

```{r}
available_releases()
```


-----------

Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.


[![ropensci_footer](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)


Owner

  • Name: rOpenSci
  • Login: ropensci
  • Kind: organization
  • Email: info@ropensci.org
  • Location: Berkeley, CA

CodeMeta (codemeta.json)

{
  "@context": [
    "https://doi.org/doi:10.5063/schema/codemeta-2.0",
    "http://schema.org"
  ],
  "@type": "SoftwareSourceCode",
  "identifier": "rfishbase",
  "description": "A programmatic interface to 'FishBase', re-written\n    based on an accompanying 'RESTful' API. Access tables describing over 30,000\n    species of fish, their biology, ecology, morphology, and more. This package also\n    supports experimental access to <http://www.sealifebase.org> data, which contains\n    nearly 200,000 species records for all types of aquatic life not covered by\n    'FishBase.'",
  "name": "rfishbase: R Interface to 'FishBase'",
  "codeRepository": "https://github.com/ropensci/rfishbase",
  "issueTracker": "https://github.com/ropensci/rfishbase/issues",
  "license": "https://spdx.org/licenses/CC0-1.0",
  "version": "3.0.3",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "version": "3.5.2",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 3.5.2 (2018-12-20)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Central R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    },
    {
      "@type": "Person",
      "givenName": "Scott",
      "familyName": "Chamberlain",
      "email": "myrmecocystus@gmail.com",
      "@id": "https://orcid.org/0000-0003-1444-9135"
    },
    {
      "@type": "Person",
      "givenName": "Duncan",
      "familyName": "Temple Lang"
    },
    {
      "@type": "Person",
      "givenName": "Peter",
      "familyName": "Wainwright"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Carl",
      "familyName": "Boettiger",
      "email": "cboettig@gmail.com",
      "@id": "https://orcid.org/0000-0002-1642-628X"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "devtools",
      "name": "devtools",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=devtools"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    }
  ],
  "softwareRequirements": [
    {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 3.0"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "dplyr",
      "name": "dplyr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=dplyr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "purrr",
      "name": "purrr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=purrr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "methods",
      "name": "methods"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "utils",
      "name": "utils"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "memoise",
      "name": "memoise",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=memoise"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "readr",
      "name": "readr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=readr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rlang",
      "name": "rlang",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rlang"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "magrittr",
      "name": "magrittr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=magrittr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "stringr",
      "name": "stringr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=stringr"
    }
  ],
  "contIntegration": "https://travis-ci.org/ropensci/rfishbase",
  "releaseNotes": "https://github.com/ropensci/rfishbase/blob/master/NEWS.md",
  "readme": "https://github.com/ropensci/rfishbase/blob/master/README.md",
  "fileSize": "1611.34KB",
  "citation": [
    {
      "@type": "ScholarlyArticle",
      "datePublished": "2012",
      "author": [
        {
          "@type": "Person",
          "givenName": "Carl",
          "familyName": "Boettiger",
          "email": "cboettig@ropensci.org"
        },
        {
          "@type": "Person",
          "givenName": "Duncan",
          "familyName": "Temple Lang"
        },
        {
          "@type": "Person",
          "givenName": "Peter",
          "familyName": "Wainwright"
        }
      ],
      "name": "rfishbase: exploring, manipulating and visualizing {FishBase} data from R",
      "url": "http://dx.doi.org/10.1111/j.1095-8649.2012.03464.x",
      "isPartOf": {
        "@type": "PublicationIssue",
        "datePublished": "2012",
        "isPartOf": {
          "@type": [
            "PublicationVolume",
            "Periodical"
          ],
          "name": "Journal of Fish Biology"
        }
      }
    }
  ],
  "review": {
    "@type": "Review",
    "url": "https://github.com/ropensci/onboarding/issues/137",
    "provider": "http://ropensci.org"
  },
  "keywords": [
    "r",
    "rstats",
    "r-package",
    "fishbase",
    "taxonomy",
    "fish"
  ],
  "relatedLink": "https://CRAN.R-project.org/package=rfishbase"
}

GitHub Events

Total
  • Issues event: 15
  • Watch event: 8
  • Issue comment event: 29
  • Push event: 2
  • Pull request event: 5
  • Fork event: 5
Last Year
  • Issues event: 15
  • Watch event: 8
  • Issue comment event: 29
  • Push event: 2
  • Pull request event: 5
  • Fork event: 5

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 588
  • Total Committers: 18
  • Avg Commits per committer: 32.667
  • Development Distribution Score (DDS): 0.204
Past Year
  • Commits: 19
  • Committers: 2
  • Avg Commits per committer: 9.5
  • Development Distribution Score (DDS): 0.368
Top Committers
Name Email Commits
Carl Boettiger c****g@g****m 468
Scott Chamberlain m****s@g****m 47
Carl Boettiger c****g@g****m 19
Philipp Neubauer n****l@g****m 12
rstudio r****o@e****m 10
Carl Boettiger c****l@r****g 7
Guohuan Su 3****u 7
Tim Poisot t****t@u****a 4
Harry Ganz h****z@r****u 3
Karthik Ram k****m@g****m 2
Tim Poisot t****t@g****m 2
Cotton Rockwood c****d@g****m 1
Kevin Cazelles k****e@u****a 1
jsta j****k@u****u 1
rOpenSci Bot m****t@g****m 1
Harry Ganz h****z 1
Casey O'Hara c****a@g****m 1
Ben Raymond b****d@a****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 271
  • Total pull requests: 36
  • Average time to close issues: 9 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 167
  • Total pull request authors: 13
  • Average comments per issue: 3.86
  • Average comments per pull request: 1.36
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 20
  • Pull requests: 3
  • Average time to close issues: 14 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 18
  • Pull request authors: 1
  • Average comments per issue: 1.75
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • cboettig (41)
  • sckott (20)
  • amroco (7)
  • jatalah (5)
  • andybeet (5)
  • melissaszy (4)
  • jebyrnes (3)
  • kairos35 (3)
  • CottonRockwood (3)
  • nschiett (3)
  • reginaldo-re (3)
  • MichaelJSchram (2)
  • sborstein (2)
  • luozhisen (2)
  • tjquimpo (2)
Pull Request Authors
  • cboettig (14)
  • guohuansu (6)
  • sckott (5)
  • Philipp-Neubauer (4)
  • karthik (2)
  • tpoisot (2)
  • raymondben (1)
  • kant (1)
  • jsta (1)
  • CottonRockwood (1)
  • harryganz (1)
  • oharac (1)
  • KevCaz (1)
Top Labels
Issue Labels
bug (11) Done in 2.0 (8) feature request (6) API-related (4) Done in 3.0 (4)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 856 last-month
  • Total docker downloads: 109,117
  • Total dependent packages: 7
    (may contain duplicates)
  • Total dependent repositories: 24
    (may contain duplicates)
  • Total versions: 31
  • Total maintainers: 1
cran.r-project.org: rfishbase

R Interface to 'FishBase'

  • Versions: 29
  • Dependent Packages: 7
  • Dependent Repositories: 24
  • Downloads: 856 Last month
  • Docker Downloads: 109,117
Rankings
Docker downloads count: 0.0%
Forks count: 1.9%
Stargazers count: 3.9%
Average: 5.0%
Dependent repos count: 5.6%
Dependent packages count: 6.4%
Downloads: 12.0%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/ropensci/rfishbase
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.0 depends
  • DBI * imports
  • contentid >= 0.0.15 imports
  • dbplyr * imports
  • dplyr * imports
  • duckdb * imports
  • jsonlite * imports
  • magrittr * imports
  • memoise * imports
  • methods * imports
  • progress * imports
  • purrr * imports
  • readr >= 2.0.0 imports
  • rlang * imports
  • rstudioapi * imports
  • stringr * imports
  • tibble * imports
  • tools * imports
  • utils * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite