A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

rfisheries

Interacting with fisheries databases at openfisheries.org.
https://github.com/ropensci/rfisheries

Category: Biosphere
Sub Category: Marine Life and Fishery

Keywords

fisheries open-data openfisheries r r-package rstats

Keywords from Contributors

genome biodiversity geocode data-access ecology occurrences doi crossref-api taxize gbif

Last synced: about 18 hours ago
JSON representation

Repository metadata

package for interacting with fisheries databases at openfisheries.org

README.md

Linux: travis
Windows: Build status
CRAN_downloads

rfisheries

beta logo

This package provides programmatic access to the openfisheries API.
Open Fisheries is a platform that aggregates global fishery data and currently offers global fish capture landings from 1950 onwards (more data coming soon). Read more about that effort here.

Installing

install.packages("rfisheries")

or grab the development version. To install this version you'll need the devtools package first.

# install.packages('devtools')
devtools::install_github('ropensci/rfisheries')

Usage

Package currently provides three basic functions. Landings data can be obtained by calling landings()

library(rfisheries)
of_landings()
   catch year
1 19234925 1950
2 21691884 1951
3 23653027 1952
4 24076599 1953
5 25988306 1954
6 27510779 1955
...

# To get country specific data, provide a iso3c country code

of_landings(country = "USA")
    catch year
1 2629961 1950
2 2452312 1951
3 2472565 1952
4 2534099 1953
5 2596039 1954
6 2621021 1955
...

# To get species specific landings, provide the correct a3 code for the required species.

of_landings(species = "SKJ")
   catch year
1 162750 1950
2 185848 1951
3 157411 1952
4 164629 1953
5 210702 1954
6 189223 1955
...

If you don't have know the correct species or country codes, you can get a complete list with the following two functions.

of_species_codes()
         scientific_name   taxocode a3_code isscaap
1     Petromyzon marinus 1020100101     LAU      25
2   Lampetra fluviatilis 1020100201     LAR      25
3    Lampetra tridentata 1020100202     LAO      25
4 Ichthyomyzon unicuspis 1020100401     LAY      25
5    Eudontomyzon mariae 1020100501     LAF      25
6      Geotria australis 1020100701     LAE      25
             english_name
1             Sea lamprey
2           River lamprey
3         Pacific lamprey
4          Silver lamprey
5 Ukrainian brook lamprey
6         Pouched lamprey
...

# Similarly you can get a full list of country codes
of_country_codes()
         country iso3c
1    Afghanistan   AFG
2        Albania   ALB
3        Algeria   DZA
4 American Samoa   ASM
5        Andorra   AND
6         Angola   AGO

Example: Compare landings from multiple countries

library(plyr)
library(rfisheries)
countries <- of_country_codes()
# let's take a small subset, say 5 random countries
c_list <- countries[sample(nrow(countries), 5),]$iso3c
# and grab landings data for these countries
results <- ldply(c_list, function(x) {
    df <- of_landings(country = x)
    df$country  <-  x
    df
}, .progress = 'text')

You can easily compare these results

library(ggplot2)
ggplot(results, aes(year, catch, group = country, color = country)) + geom_line()

multiple countries

Similarly you can get landings data for multiple species. As the API evolves, we'll update the package and get it to CRAN at some point.

Creative interactive charts

Using the rCharts library, it's easy to create interactive plots. Here's a quick example.

library(rfisheries)
library(rCharts)
cod <- of_landings(species = "COD")
cod$date <- paste0(cod$year, "-01", "-01")
cod_plot <- mPlot(x = "date", y = "catch", type = "Line", data = cod)
cod_plot$set(pointSize = 0, lineWidth = 4)
cod_plot

Please report any issues or bugs.

License: MIT

This package is part of the rOpenSci project.

To cite package ‘rfisheries’ in publications use:

  Karthik Ram, Carl Boettiger and Andrew Dyck (2013). rfisheries: R
  interface for fisheries data. R package version 0.1.
  http://CRAN.R-project.org/package=rfisheries

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {rfisheries: R interface for fisheries data},
    author = {Karthik Ram and Carl Boettiger and Andrew Dyck},
    year = {2013},
    note = {R package version 0.1},
    url = {http://CRAN.R-project.org/package=rfisheries},
  }

footer


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 126
Total Committers: 6
Avg Commits per committer: 21.0
Development Distribution Score (DDS): 0.151

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Karthik Ram k****m@g****m 107
Carl Boettiger c****g@g****m 8
Scott Chamberlain m****s@g****m 5
Andrew J Dyck g****b@a****m 3
Katrin Leinweber 9****r 2
rOpenSci Bot m****t@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 18
Total pull requests: 6
Average time to close issues: 4 months
Average time to close pull requests: 9 days
Total issue authors: 7
Total pull request authors: 4
Average comments per issue: 2.28
Average comments per pull request: 0.5
Merged pull request: 5
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ropensci/rfisheries

Top Issue Authors

  • karthik (10)
  • sckott (3)
  • matteodefelice (1)
  • Pielewuiter (1)
  • hadley (1)
  • CottonRockwood (1)
  • andrewdeines (1)

Top Pull Request Authors

  • katrinleinweber (2)
  • sckott (2)
  • karthik (1)
  • mpadge (1)

Top Issue Labels

  • 0 - Backlog (1)
  • 4 - Done (1)

Top Pull Request Labels


Package metadata

cran.r-project.org: rfisheries

'Programmatic Interface to the 'openfisheries.org' API'

  • Homepage: http://www.github.com/ropensci/rfisheries
  • Documentation: http://cran.r-project.org/web/packages/rfisheries/rfisheries.pdf
  • Licenses: MIT + file LICENSE
  • Latest release: 0.0.6 (published over 11 years ago)
  • Last Synced: 2025-04-25T12:05:41.432Z (2 days ago)
  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 232 Last month
  • Docker Downloads: 88,618
  • Rankings:
    • Forks count: 6.926%
    • Stargazers count: 10.759%
    • Average: 23.588%
    • Dependent repos count: 24.382%
    • Dependent packages count: 27.984%
    • Downloads: 47.887%
  • Maintainers (1)

Dependencies

DESCRIPTION cran
  • R >= 2.15 depends
  • assertthat * imports
  • data.table * imports
  • ggplot2 * imports
  • httr * imports
  • rjson * imports

Score: 16.712858591629086