This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rglobi::query('START predatorTaxon = node:taxons(name="Homo sapiens") | |
MATCH predatorTaxon<-[:CLASSIFIED_AS]-predator-[:ATE|PREYS_ON]->prey-[:CLASSIFIED_AS]->preyTaxon, | |
predator-[:COLLECTED_AT]->location-[:HAS_ENVIRONMENT]->envo | |
WHERE envo.name= "coast" | |
WITH envo, preyTaxon, predatorTaxon | |
MATCH preyTaxon<-[:CLASSIFIED_AS]-pred2-[:ATE]->prey2-[:CLASSIFIED_AS]->preyOfPreyTaxon | |
RETURN envo.externalId, envo.name, preyTaxon.commonNames?, preyTaxon.path?, predatorTaxon.name as predatorName, preyTaxon.name as preyName, count(distinct preyOfPreyTaxon.name) as preyOfPreyCount') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css"/> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script> | |
<script src="https://rawgit.com/jhpoelen/eol-globi-data-js/master/globi-data-dist.js"></script> | |
<style> | |
html, body { | |
width: 100%; | |
height: 100%; | |
padding: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# retrieve trophic interactions related to species | |
# that were recorded at or near McLaren Park | |
# using GloBI and GBIF | |
install.packages(c('rglobi', 'rgbif')) | |
mcLarenWKT <- 'POLYGON((-122.435 37.726,-122.406 37.726, -122.406 37.710, -122.435 37.710, -122.435 37.726))' | |
mcLarenObs <- rgbif::occ_search(geometry= mcLarenWKT) | |
gbifSpeciesKeys <- na.omit(unique(mcLarenObs$data$speciesKey)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"creator":"jhpoelen", | |
"notification_address": ["[email protected]"], | |
"predicate": | |
{ | |
"type":"and", | |
"predicates": [ | |
{"type":"equals","key":"HAS_GEOSPATIAL_ISSUE","value":"false"}, | |
{"type":"equals","key":"HAS_COORDINATE","value":"true"} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install rglobi (see ropensci.org for more info) | |
install.packages(c('rglobi')) | |
# read species list after exporting as csv | |
krak <- read.csv(file='Krak_list_DELETE.csv', stringsAsFactors=F) | |
# pick unique families | |
taxonList <- unique(krak$Family) | |
# find and aggregate interactions for each species . . . one by one | |
interactions <- Reduce(function(accum, taxon) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install rgbif and rglobi libraries (see http://ropensci.org for more info) | |
install.packages(c('rgbif', 'rglobi')) | |
# define geometric bounding box (around california) | |
geo1 <- "POLYGON((-126 32, -114 32, -114 41, -126 41, -126 32))" | |
# retrieve a bunch of occurrences of Mustelidae with the geometric area | |
mustelidaeOcc <- rgbif::occ_search(scientificName='Mustelidae', fields='minimal', geometry = geo1)$data | |
# get any interactions records involving unique taxa occurrences at bbox geo1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see Jorrit H. Poelen, James D. Simons and Chris J. Mungall. (2014). Global Biotic Interactions: An open infrastructure to share and | |
# analyze species-interaction datasets. Ecological Informatics. http://dx.doi.org/10.1016/j.ecoinf.2014.08.005 | |
# rasterize locations, retrieve stats for bounding boxes, plot graphs | |
if (!'package:raster' %in% search()) { | |
install.packages(c('raster','maps'), repos='http://cran.us.r-project.org') | |
library('raster') | |
library('maps') | |
} |