The code below fetches copepod data from OBIS and uses different approaches to find records collected using the Underwater Vision Profiler (UVP). At the time of writing (December 2019), no records were found.
Load packages:
library(robis)
library(dplyr)
library(stringr)
library(ggplot2)
Fetch Copepoda data (this will take a while) and cache:
filename <- "copepoda.temp"
if (!file.exists(filename)) {
df <- occurrence("Copepoda", mof = TRUE, fields = c("id", "dataset_id", "eventDate", "decimalLongitude", "decimalLatitude", "scientificName", "samplingProtocol", "dynamicProperties"))
save(df, file = filename)
} else {
load(filename)
}
Plot map:
ggplot() +
geom_point(data = df %>% distinct(decimalLongitude, decimalLatitude), aes_string(x = "decimalLongitude", y = "decimalLatitude"), size = 1, stroke = 0.6, alpha = 0.3, colour = "#ff3399") +
borders("world", colour = "#000000", fill = NA) +
coord_quickmap() + theme_void()
Extract MeasurementsOrFacts records:
mof <- measurements(df, fields = c("id", "decimalLongitude", "decimalLatitude", "scientificName"))
Get most common measurement and fact types:
types <- data.frame(table(mof$measurementType)) %>%
arrange(desc(Freq))
head(types, n = 10)
## Var1 Freq
## 1 Sampling instrument 1393340
## 2 Abundance 193189
## 3 abundance 60324
## 4 NetMeshSize 53224
## 5 SamplingDeviceApertureSurfaceArea 42138
## 6 Biomass 37500
## 7 Count 30093
## 8 Bottom depth 29745
## 9 mesh size 29745
## 10 net area 29745
Find sampling gear related facts:
gear <- mof %>%
filter(measurementType %in% c("Sampling instrument", "sampling gear", "sampling device", "Sampling instrument name", "Sampling device", "Platform Name", "Platform Type"))
gearTypes <- data.frame(table(gear$measurementValue)) %>%
arrange(desc(Freq))
head(gearTypes, n = 10)
## Var1 Freq
## 1 CPR Tow 1333621
## 2 WP2 net 42235
## 3 WP-2 21430
## 4 WP-2, new, window 8315
## 5 Plankton net 6136
## 6 Haul 4275
## 7 juday net 3550
## 8 plankton net 2136
## 9 WP2 net (56 cm diameter) 1838
## 10 Plankton net (d70cm) 1700
None of the sampling gear types includes UVP.
Find occurrences records with uvp in samplingProtocol or dynamicProperties:
uvp <- df %>%
filter(
str_detect(samplingProtocol, fixed("uvp", ignore_case = TRUE))
| str_detect(dynamicProperties, fixed("uvp", ignore_case = TRUE))
)
head(uvp)
## [1] scientificName dataset_id decimalLongitude decimalLatitude
## [5] id eventDate mof samplingProtocol
## [9] dynamicProperties
## <0 rows> (or 0-length row.names)
Fetch Copepoda dataset metadata:
meta <- dataset("Copepoda")
Find metadata records with uvp in the abstract:
meta_uvp <- meta %>%
filter(str_detect(abstract, fixed("uvp", ignore_case = TRUE)))
head(meta_uvp)
## [1] id url archive published
## [5] updated core extensions title
## [9] citation citation_id abstract intellectualrights
## [13] nodes keywords records node_id
## [17] node_name
## <0 rows> (or 0-length row.names)