Canary Current LME robis demo
This notebook is a quick demonstration of the robis R package for fetching occurrence data relevant to the Canary Current LME.
Dependencies
library(robis)
library(dplyr)
library(ggplot2)
library(sf)
library(rnaturalearth)Fetching occurrences
The OBIS database has a number of geographic areas against which the occurrence data are indexed. This includes LMEs. Use the areas() function to get a list of LME area identifiers.
areas <- area() %>%
filter(type == "lme")
areas %>% rmarkdown::paged_table()
Then use the Canary Current LME area ID as a filter in the occurrence() function.
occ <- occurrence(areaid = 40027)
occ## # A tibble: 98,765 Ă— 197
## country date_year scientificNameID superorder year scientificName absence
## <chr> <int> <chr> <chr> <chr> <chr> <lgl>
## 1 FRANCE 1971 urn:lsid:marine… Peracarida 1971 Hyperiidea FALSE
## 2 <NA> NA urn:lsid:marine… <NA> <NA> Katsuwonus pe… FALSE
## 3 <NA> 1921 urn:lsid:marine… Elopomorp… 1921 Anguilla FALSE
## 4 <NA> 1975 urn:lsid:marine… <NA> 1975 Paragloborota… FALSE
## 5 <NA> 1996 urn:lsid:marine… <NA> 1996 Reophax biloc… FALSE
## 6 <NA> 1984 urn:lsid:marine… Peracarida 1984 Leucon (Epile… FALSE
## 7 FRANCE 1975 urn:lsid:marine… <NA> 1975 Biota FALSE
## 8 <NA> NA urn:lsid:marine… <NA> <NA> Katsuwonus pe… FALSE
## 9 <NA> 1981 urn:lsid:marine… <NA> 1981 <NA> FALSE
## 10 SOVIET UN… 1970 urn:lsid:marine… Podoplea 1970 Microsetella … FALSE
## # … with 98,755 more rows, and 190 more variables: dropped <lgl>,
## # superorderid <int>, aphiaID <int>, decimalLatitude <dbl>, subclassid <int>,
## # originalScientificName <chr>, marine <lgl>, minimumDepthInMeters <dbl>,
## # phylumid <int>, subphylumid <int>, occurrenceStatus <chr>,
## # basisOfRecord <chr>, superclass <chr>, date_mid <dbl>,
## # maximumDepthInMeters <dbl>, id <chr>, class <chr>, order <chr>,
## # suborder <chr>, superclassid <int>, orderid <int>, dataset_id <chr>, …
Let’s create a map:
land <- ne_coastline(returnclass = "sf", scale = "large")
ggplot() +
geom_sf(data = land, size = 0.5) +
geom_sf(data = occ %>% st_as_sf(coords = c("decimalLongitude", "decimalLatitude"), crs = 4326), size = 0.1, color = "#45add6") +
coord_sf(xlim = c(-26, -3), ylim = c(10, 38), default_crs = sf::st_crs(4326)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())WRiMS taxa
While it’s possible to filter the dataframe we downloaded earlier based on value in the wrims column, the occurrence() function also has a wrims filter which restricts results to species listed in the World Register of Introduced Marine Species (WRiMS). Note that this currently does not take into account native versus introduced ranges.
occ_wrims <- occurrence(areaid = 40027, wrims = TRUE)
occ_wrims## # A tibble: 2,428 Ă— 151
## infraphylum date_year scientificNameID year scientificName dropped
## <chr> <int> <chr> <chr> <chr> <lgl>
## 1 Gnathostomata 2003 urn:lsid:marinespecies.… 2003 Chromis limba… FALSE
## 2 Gnathostomata 2003 urn:lsid:marinespecies.… 2003 Chromis limba… FALSE
## 3 Gnathostomata NA urn:lsid:marinespecies.… <NA> Microchirus a… FALSE
## 4 <NA> 1971 urn:lsid:marinespecies.… 1971 Acteocina kno… FALSE
## 5 Gnathostomata 2004 urn:lsid:marinespecies.… 2004 Chromis limba… FALSE
## 6 <NA> 1966 urn:lsid:marinespecies.… 1966 Pulleniatina … FALSE
## 7 Gnathostomata NA urn:lsid:marinespecies.… <NA> Seriola lalan… FALSE
## 8 <NA> 2014 urn:lsid:marinespecies.… 2014 Palaemon eleg… FALSE
## 9 Gnathostomata NA urn:lsid:marinespecies.… <NA> Conger conger FALSE
## 10 Gnathostomata NA 127240 <NA> Pontinus kuhl… FALSE
## # … with 2,418 more rows, and 145 more variables: gigaclassid <int>,
## # aphiaID <int>, language <chr>, decimalLatitude <dbl>, subclassid <int>,
## # gigaclass <chr>, infraphylumid <int>, phylumid <int>, familyid <int>,
## # catalogNumber <chr>, occurrenceStatus <chr>, basisOfRecord <chr>,
## # terrestrial <lgl>, modified <chr>, maximumDepthInMeters <dbl>, id <chr>,
## # day <chr>, parvphylum <chr>, order <chr>, dataset_id <chr>,
## # decimalLongitude <dbl>, collectionCode <chr>, date_end <dbl>, …
ggplot() +
geom_sf(data = land, size = 0.5) +
geom_sf(data = occ_wrims %>% st_as_sf(coords = c("decimalLongitude", "decimalLatitude"), crs = 4326), size = 0.1, color = "#45add6") +
coord_sf(xlim = c(-26, -3), ylim = c(10, 38), default_crs = sf::st_crs(4326)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())Let’s take a look at the most common WRiMS species for the CCLME:
occ_wrims %>%
filter(!is.na(species)) %>%
group_by(class, species) %>%
summarize(records = n()) %>%
arrange(desc(records)) %>%
rmarkdown::paged_table()