Created
February 16, 2016 22:18
-
-
Save jhpoelen/5da69134fee8546f28a9 to your computer and use it in GitHub Desktop.
McLaren Park Observations and Interactions
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)) | |
globiTaxonIds <- paste('GBIF:', gbifSpeciesKeys, sep='') | |
trophicInteractions <- rglobi::get_interactions_by_taxa(sourcetaxon = globiTaxonIds, interactiontype='eats') | |
head(trophicInteractions) | |
trophicInteractions <- rglobi::get_interactions_by_taxa(sourcetaxon = globiTaxonIds, interactiontype='eats', showfield = c('source_taxon_external_id', 'source_taxon_path', 'interaction_type', 'target_taxon_external_id', 'target_taxon_path')) | |
#> head(trophicInteractions) | |
# source_taxon_external_id | |
#1 GBIF:7342009 | |
#2 GBIF:7341805 | |
#3 GBIF:7341805 | |
#4 GBIF:7341600 | |
#5 GBIF:7341600 | |
## GBIF:7341600 | |
# source_taxon_path | |
#1 Animalia | Chordata | Aves | Passeriformes | Parulidae | Oreothlypis | Oreothlypis celata | |
#2 Animalia | Chordata | Aves | Passeriformes | Parulidae | Setophaga | Setophaga coronata | |
#3 Animalia | Chordata | Aves | Passeriformes | Parulidae | Setophaga | Setophaga coronata | |
#4 Animalia | Chordata | Aves | Passeriformes | Emberizidae | Melozone | Melozone crissalis | |
#5 Animalia | Chordata | Aves | Passeriformes | Emberizidae | Melozone | Melozone crissalis | |
#6 Animalia | Chordata | Aves | Passeriformes | Emberizidae | Melozone | Melozone crissalis | |
# interaction_type target_taxon_external_id | |
#1 eats GBIF:2013501 | |
#2 eats GBIF:2882803 | |
#3 eats GBIF:3190628 | |
#4 eats GBIF:3020559 | |
#5 eats GBIF:3190621 | |
#6 eats GBIF:1875 | |
# target_taxon_path | |
#1 Animalia | Arthropoda | Insecta | Hemiptera | Psylloidea | Psyllidae | Glycaspis | Glycaspis brimblecombei | |
#2 Plantae | Magnoliophyta | Magnoliopsida | Ericales | Ericaceae | Arbutus | Arbutus unedo | |
#3 Plantae | Magnoliophyta | Magnoliopsida | Sapindales | Anacardiaceae | Toxicodendron | Toxicodendron radicans | |
#4 Plantae | Magnoliophyta | Magnoliopsida | Rosales | Rosaceae | Prunus | |
#5 Plantae | Magnoliophyta | Magnoliopsida | Sapindales | Anacardiaceae | Toxicodendron | Toxicodendron diversilobum | |
#6 Animalia | Arthropoda | Insecta | Lepidoptera | Papilionoidea | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment