knitr::opts_chunk$set(
  comment = "#>", 
  warning = FALSE, 
  message = FALSE,
  cache = TRUE
)

rglobi vignette - an R interface to the aggregated biotic interaction data of GloBI (https://www.globalbioticinteractions.org)

About the package

rglobi allows easy access to the GLoBI database by wrapping the existing API.


Quick start

First, install rglobi

install.packages("devtools")
devtools::install_github("ropensci/rglobi")
library("rglobi")

Note that since rglobi is still pretty new, only the dev version of the library is available at this time. We hope to publish a version to CRAN once the library matures. For more information see GitHub.

Find interactions involving a certain species

Determining which species interact with each other (and how and where) is a major focus of ecology. The Global Biotic Interactions Database offers data on multiple interaction types, and the rglobi library offers several ways to specify and access these interactions. get_interactions() is the primary function used if data on a specific interaction type is required. A focus taxon is entered (may be specified as "Genus species" or higher level (e.g., Genus, Family, Class)).

hsapiens <- get_interactions(taxon = "Homo sapiens", interaction.type = "preysOn")
head(hsapiens)

get_predators_of() and get_prey_of() are wrappers for get_interactions() that remove the need to specify interaction type

hsapiens <- get_prey_of("Homo sapiens")
head(hsapiens)

For a complete list of supported interaction types,

get_interaction_types()

For data sources in which type of interactions was not specified, the interaction is labeled "interacts_with".

If you wish to view all interactions instead of specific types (e.g., parasitism and predation instead of just one of the two), the get_interactions_by_taxa() function allows this. In addition, the function provides options to search for interactions between two groups (source and target taxa, see above table) and only find interactions in a certain region.

rattus <- get_interactions_by_taxa(sourcetaxon = "Rattus")
head(rattus)

Only a source taxa need be identified, but you can also specify a target taxon and/or geographic boundary (Coordinates must be in decimal degrees (EPSG:4326) and correspond to the west, south, east, and northern boundaries (i.e., min x, min y, max x, max y).

aves_crustacea_northern_hemisphere <- get_interactions_by_taxa( sourcetaxon = "Aves", targettaxon = "Crustacea", bbox=c(-180, 0, 180, 90 ))
head(aves_crustacea_northern_hemisphere)

Find interactions in a geographic areas

Instead of a taxon-specific approach, users may also wish to gather information on all interactions occuring in a specific area. For example, a group developing ecoystem models for the Gulf of Mexico may want to consider all the data from that region. rglobi enables this type of search by allowing users to specify a rectangular bounding box. Coordinates must be in decimal degrees (EPSG:4326) and correspond to the west, south, east, and northern boundaries (i.e., min x, min y, max x, max y).

gulfinteractions <- get_interactions_in_area( bbox=c(-97.0, 17.5, -81, 31))
head(gulfinteractions)

To see all locations for which interactions have entered in GloBi,

areas <- get_interaction_areas()
head(areas)

You can also restrict this search to a certain area:

areas <- get_interaction_areas (bbox=c(-67.87,12.79,-57.08,23.32))
head(areas)


ropensci/rglobi documentation built on Oct. 18, 2023, 7:55 a.m.