diff --git a/.Rbuildignore b/.Rbuildignore index 072055c..e75f956 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,6 @@ .travis.yml .gitignore inst/.gitkeep +inst/vign cran-comments.md +Makefile diff --git a/DESCRIPTION b/DESCRIPTION index 8a73cdf..0a5efca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,7 @@ Description: A programmatic interface to the web service methods taxonomic name. In addition, it supports Cypher, a graph query language, to allow for executing custom queries on the GloBI aggregate species interaction dataset. -Version: 0.2.3 +Version: 0.2.4 Date: 2015-01-27 Authors@R: c(person("Jorrit", "Poelen", role = c("aut", "cre"), email = "jhpoelen@xs4all.nl"), diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8f0dd3b --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +all: move rmd2md + +move: + cp inst/vign/rglobi_vignette.md vignettes + +rmd2md: + cd vignettes;\ + mv rglobi_vignette.md rglobi_vignette.Rmd diff --git a/cran-comments.md b/cran-comments.md index 730ec1b..0bf6ed0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,11 @@ Dear Reviewers: -I build this package using [R CMD build .] and checked is with command [R CMD check --as-cran rglobi_0.2.3.tar.gz] on my Mac OS X (v 10.9.5) machine running R 3.1.2 . Also, the checks were executed on travis-ci.org (running Ubuntu) and winbuilder (running windows). I found no errors, but did observe the following note: +I build this package using [R CMD build .] and checked is with command [R CMD check --as-cran rglobi_0.2.4.tar.gz] on my Mac OS X (v 10.9.5) machine running R 3.1.2 . Also, the checks were executed on travis-ci.org (running Ubuntu) and winbuilder (running windows). +Fixes: +* Resolved issue found by Prof Brian Ripley in rglobi v0.2.3 regarding the note: "Package has a VignetteBuilder field but no prebuilt vignette index." + +The remaining note for this version is: * checking CRAN incoming feasibility ... NOTE Maintainer: ‘Jorrit Poelen ’ New submission @@ -10,10 +14,7 @@ Components with restrictions and base license permitting such: File 'LICENSE': YEAR: 2015 COPYRIGHT HOLDER: Jorrit Poelen -Package has a VignetteBuilder field but no prebuilt vignette index. Thank you for taking the time to review my submission. -jorrit - -PS Please note that initially, I attempted to submit the package v0.2.2 using the devtools::release command. However, after learning that this is not supported, I reverted to the official submit page I am using now. \ No newline at end of file diff --git a/vignettes/vignette.RMD b/inst/vign/rglobi_vignette.Rmd similarity index 95% rename from vignettes/vignette.RMD rename to inst/vign/rglobi_vignette.Rmd index 06bd1f9..d231a76 100644 --- a/vignettes/vignette.RMD +++ b/inst/vign/rglobi_vignette.Rmd @@ -1,8 +1,17 @@ +```{r echo=FALSE, eval=FALSE} +knitr::opts_chunk$set( + comment = "#>", + warning = FALSE, + message = FALSE, + cache = TRUE +) +``` + rglobi vignette - an R interface to the aggregated biotic interaction data of GloBI (http://globalbioticinteractions.org) ====== @@ -19,7 +28,7 @@ rglobi vignette - an R interface to the aggregated biotic interaction data of Gl ```{r} install.packages("devtools") -devtools::install_github("rglobi", "ropensci") +devtools::install_github("ropensci/rglobi") ``` ```{r} diff --git a/vignettes/vignette.md b/inst/vign/rglobi_vignette.md similarity index 88% rename from vignettes/vignette.md rename to inst/vign/rglobi_vignette.md index 169531c..3716a81 100644 --- a/vignettes/vignette.md +++ b/inst/vign/rglobi_vignette.md @@ -1,8 +1,10 @@ + + rglobi vignette - an R interface to the aggregated biotic interaction data of GloBI (http://globalbioticinteractions.org) ====== @@ -22,31 +24,22 @@ rglobi vignette - an R interface to the aggregated biotic interaction data of Gl install.packages("devtools") ``` -``` -## Installing package into '/Volumes/Data/Users/unencrypted/jorrit/Library/R/3.0/library' -## (as 'lib' is unspecified) -``` - ``` ## ## The downloaded binary packages are in -## /var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T//RtmptgaLYk/downloaded_packages +## /var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T//RtmpF6qc1T/downloaded_packages ``` ```r -devtools::install_github("rglobi", "ropensci") -``` - -``` -## Warning: Username parameter is deprecated. Please use ropensci/rglobi +devtools::install_github("ropensci/rglobi") ``` ``` ## Downloading github repo ropensci/rglobi@master ## Installing rglobi ## '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL \ -## '/private/var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T/RtmptgaLYk/devtools1fd744d4751b/ropensci-rglobi-7ec6694' \ -## --library='/Volumes/Data/Users/unencrypted/jorrit/Library/R/3.0/library' \ +## '/private/var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T/RtmpF6qc1T/devtools15b730380a08/ropensci-rglobi-0b49250' \ +## --library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library' \ ## --install-tests ## ## Reloading installed rglobi @@ -252,41 +245,41 @@ head(aves_crustacea_northern_hemisphere) ``` ``` -## source_taxon_external_id source_taxon_name -## 1 EOL:18884 Cepphus -## 2 EOL:1049577 Larus marinus -## 3 EOL:1049366 Pluvialis squatarola -## 4 EOL:1049366 Pluvialis squatarola -## 5 EOL:1049366 Pluvialis squatarola -## 6 EOL:1048643 Phalacrocorax penicillatus -## source_taxon_path -## 1 Animalia | Chordata | Aves | Charadriiformes | Alcidae | Cepphus -## 2 Animalia | Chordata | Aves | Charadriiformes | Laridae | Larus | Larus marinus -## 3 Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola -## 4 Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola -## 5 Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola -## 6 Animalia | Chordata | Aves | Suliformes | Phalacrocoracidae | Phalacrocorax | Phalacrocorax penicillatus +## source_taxon_external_id source_taxon_name +## 1 EOL:18884 Cepphus +## 2 EOL:1047918 Anas platyrhynchos +## 3 EOL:1049560 Recurvirostra americana +## 4 EOL:1049376 Arenaria melanocephala +## 5 EOL:1048977 Bucephala albeola +## 6 EOL:1048977 Bucephala albeola +## source_taxon_path +## 1 Animalia | Chordata | Aves | Charadriiformes | Alcidae | Cepphus +## 2 Animalia | Chordata | Aves | Anseriformes | Anatidae | Anas | Anas platyrhynchos +## 3 Animalia | Chordata | Aves | Charadriiformes | Recurvirostridae | Recurvirostra | Recurvirostra americana +## 4 Animalia | Chordata | Aves | Charadriiformes | Scolopacidae | Arenaria | Arenaria melanocephala +## 5 Animalia | Chordata | Aves | Anseriformes | Anatidae | Bucephala | Bucephala albeola +## 6 Animalia | Chordata | Aves | Anseriformes | Anatidae | Bucephala | Bucephala albeola ## source_specimen_life_stage interaction_type target_taxon_external_id ## 1 NA preysOn EOL:2625033 -## 2 NA preysOn EOL:35798 +## 2 NA preysOn EOL:2620777 ## 3 NA interactsWith EOL:2625033 -## 4 NA preysOn EOL:2615930 -## 5 NA preysOn EOL:2620777 -## 6 NA interactsWith EOL:2625033 +## 4 NA preysOn EOL:2620777 +## 5 NA interactsWith EOL:2625033 +## 6 NA preysOn EOL:2620777 ## target_taxon_name ## 1 Copepoda -## 2 Balanus +## 2 Gammaridea ## 3 Copepoda -## 4 Oniscidea -## 5 Gammaridea -## 6 Copepoda -## target_taxon_path -## 1 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda -## 2 Biota | Animalia | Arthropoda | Crustacea | Maxillopoda | Thecostraca | Cirripedia | Thoracica | Sessilia | Balanomorpha | Balanoidea | Balanidae | Balaninae | Balanus -## 3 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda -## 4 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Isopoda | Oniscidea -## 5 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea -## 6 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda +## 4 Gammaridea +## 5 Copepoda +## 6 Gammaridea +## target_taxon_path +## 1 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda +## 2 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea +## 3 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda +## 4 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea +## 5 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda +## 6 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea ## target_specimen_life_stage latitude longitude study_title ## 1 NA NA NA NA ## 2 NA NA NA NA @@ -361,12 +354,12 @@ head(areas) ``` ## Latitude Longitude -## 1 29.35 -92.98 -## 2 29.03 -92.29 -## 3 28.04 -96.11 -## 4 27.62 -95.77 -## 5 26.33 -96.03 -## 6 30.14 -86.17 +## 1 29.34695 -92.98061 +## 2 29.03260 -92.28701 +## 3 28.03673 -96.11108 +## 4 27.62409 -95.77403 +## 5 26.33146 -96.03294 +## 6 30.25024 -86.13114 ``` You can also restrict this search to a certain area: @@ -378,10 +371,10 @@ head(areas) ``` ## Latitude Longitude -## 1251 18.25 -66.50 -## 1255 18.34 -65.83 -## 1268 18.07 -63.07 -## 1339 13.17 -59.53 +## 1251 18.24829 -66.49989 +## 1255 18.33884 -65.82572 +## 1268 18.06667 -63.06667 +## 1339 13.16667 -59.53333 ``` #### Custom Queries using Cypher diff --git a/vignettes/vignette.html b/vignettes/rglobi_vignette.Rmd similarity index 62% rename from vignettes/vignette.html rename to vignettes/rglobi_vignette.Rmd index e796a94..3716a81 100644 --- a/vignettes/vignette.html +++ b/vignettes/rglobi_vignette.Rmd @@ -1,227 +1,69 @@ - - - - - -rglobi vignette - an R interface to the aggregated biotic interaction data of GloBI (<a href="http://globalbioticinteractions.org">http://globalbioticinteractions.org</a>) - - - - - - - - - - - - - - -

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

-

About the package

-

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

+rglobi vignette - an R interface to the aggregated biotic interaction data of GloBI (http://globalbioticinteractions.org) +====== -
+### About the package -

Quick start

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

First, install rglobi

+******************** -
install.packages("devtools")
-
+### Quick start -
## Installing package into '/Volumes/Data/Users/unencrypted/jorrit/Library/R/3.0/library'
-## (as 'lib' is unspecified)
-
+#### First, install `rglobi` -
## 
-## The downloaded binary packages are in
-##  /var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T//RtmptgaLYk/downloaded_packages
-
-
devtools::install_github("rglobi", "ropensci")
-
-
## Warning: Username parameter is deprecated. Please use ropensci/rglobi
-
+```r +install.packages("devtools") +``` + +``` +## +## The downloaded binary packages are in +## /var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T//RtmpF6qc1T/downloaded_packages +``` + +```r +devtools::install_github("ropensci/rglobi") +``` -
## Downloading github repo ropensci/rglobi@master
+```
+## Downloading github repo ropensci/rglobi@master
 ## Installing rglobi
-## '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL  \
-##   '/private/var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T/RtmptgaLYk/devtools1fd744d4751b/ropensci-rglobi-7ec6694'  \
-##   --library='/Volumes/Data/Users/unencrypted/jorrit/Library/R/3.0/library'  \
+## '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL  \
+##   '/private/var/folders/v4/0_y78_xj1x7b72l89cwc2kq80000gp/T/RtmpF6qc1T/devtools15b730380a08/ropensci-rglobi-0b49250'  \
+##   --library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library'  \
 ##   --install-tests 
 ## 
 ## Reloading installed 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.

+```r +library("rglobi") +``` -

Find interactions involving a certain species

+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](https://github.com/ropensci/rglobi). -

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)).

+#### Find interactions involving a certain species -
hsapiens <- get_interactions(taxon = "Homo sapiens", interaction.type = "preysOn")
+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)).
+
+
+```r
+hsapiens <- get_interactions(taxon = "Homo sapiens", interaction.type = "preysOn")
 head(hsapiens)
-
+``` -
##   source_taxon_external_id source_taxon_name
+```
+##   source_taxon_external_id source_taxon_name
 ## 1               EOL:327955      Homo sapiens
 ## 2               EOL:327955      Homo sapiens
 ## 3               EOL:327955      Homo sapiens
@@ -263,15 +105,18 @@ 

Find interactions involving a certain species

## 4 NA NA NA NA ## 5 NA NA NA NA ## 6 NA NA NA NA -
+``` + +`get_predators_of()` and `get_prey_of()` are wrappers for `get_interactions()` that remove the need to specify interaction type -

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")
+```r
+hsapiens <- get_prey_of("Homo sapiens")
 head(hsapiens)
-
+``` -
##   source_taxon_external_id source_taxon_name
+```
+##   source_taxon_external_id source_taxon_name
 ## 1               EOL:327955      Homo sapiens
 ## 2               EOL:327955      Homo sapiens
 ## 3               EOL:327955      Homo sapiens
@@ -313,14 +158,17 @@ 

Find interactions involving a certain species

## 4 NA NA NA NA ## 5 NA NA NA NA ## 6 NA NA NA NA -
+``` -

For a complete list of supported interaction types,

+For a complete list of supported interaction types, -
get_interaction_types()
-
-
##      interaction     source     target
+```r
+get_interaction_types()
+```
+
+```
+##      interaction     source     target
 ## 1        preysOn   predator       prey
 ## 2   preyedUponBy       prey   predator
 ## 3     parasiteOf   parasite       host
@@ -331,17 +179,20 @@ 

Find interactions involving a certain species

## 8 hasPathogen plant pollinator ## 9 symbiontOf source target ## 10 interactsWith source target -
+``` + +For data sources in which type of interactions was not specified, the interaction is labeled "interacts_with". -

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. -

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")
+```r
+rattus <- get_interactions_by_taxa(sourcetaxon = "Rattus")
 head(rattus)
-
+``` -
##   source_taxon_external_id source_taxon_name
+```
+##   source_taxon_external_id source_taxon_name
 ## 1               EOL:328447     Rattus rattus
 ## 2               EOL:328447     Rattus rattus
 ## 3               EOL:328447     Rattus rattus
@@ -383,49 +234,52 @@ 

Find interactions involving a certain species

## 4 NA NA NA NA ## 5 NA NA NA NA ## 6 NA NA NA NA -
+``` -

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).

+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](http://spatialreference.org/ref/epsg/wgs-84/)) 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 ))
+
+```r
+aves_crustacea_northern_hemisphere <- get_interactions_by_taxa( sourcetaxon = "Aves", targettaxon = "Crustacea", bbox=c(-180, 0, 180, 90 ))
 head(aves_crustacea_northern_hemisphere)
-
- -
##   source_taxon_external_id          source_taxon_name
-## 1                EOL:18884                    Cepphus
-## 2              EOL:1049577              Larus marinus
-## 3              EOL:1049366       Pluvialis squatarola
-## 4              EOL:1049366       Pluvialis squatarola
-## 5              EOL:1049366       Pluvialis squatarola
-## 6              EOL:1048643 Phalacrocorax penicillatus
-##                                                                                          source_taxon_path
-## 1                                         Animalia | Chordata | Aves | Charadriiformes | Alcidae | Cepphus
-## 2                           Animalia | Chordata | Aves | Charadriiformes | Laridae | Larus | Larus marinus
-## 3           Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola
-## 4           Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola
-## 5           Animalia | Chordata | Aves | Charadriiformes | Charadriidae | Pluvialis | Pluvialis squatarola
-## 6 Animalia | Chordata | Aves | Suliformes | Phalacrocoracidae | Phalacrocorax | Phalacrocorax penicillatus
+```
+
+```
+##   source_taxon_external_id       source_taxon_name
+## 1                EOL:18884                 Cepphus
+## 2              EOL:1047918      Anas platyrhynchos
+## 3              EOL:1049560 Recurvirostra americana
+## 4              EOL:1049376  Arenaria melanocephala
+## 5              EOL:1048977       Bucephala albeola
+## 6              EOL:1048977       Bucephala albeola
+##                                                                                           source_taxon_path
+## 1                                          Animalia | Chordata | Aves | Charadriiformes | Alcidae | Cepphus
+## 2                          Animalia | Chordata | Aves | Anseriformes | Anatidae | Anas | Anas platyrhynchos
+## 3 Animalia | Chordata | Aves | Charadriiformes | Recurvirostridae | Recurvirostra | Recurvirostra americana
+## 4           Animalia | Chordata | Aves | Charadriiformes | Scolopacidae | Arenaria | Arenaria melanocephala
+## 5                      Animalia | Chordata | Aves | Anseriformes | Anatidae | Bucephala | Bucephala albeola
+## 6                      Animalia | Chordata | Aves | Anseriformes | Anatidae | Bucephala | Bucephala albeola
 ##   source_specimen_life_stage interaction_type target_taxon_external_id
 ## 1                         NA          preysOn              EOL:2625033
-## 2                         NA          preysOn                EOL:35798
+## 2                         NA          preysOn              EOL:2620777
 ## 3                         NA    interactsWith              EOL:2625033
-## 4                         NA          preysOn              EOL:2615930
-## 5                         NA          preysOn              EOL:2620777
-## 6                         NA    interactsWith              EOL:2625033
+## 4                         NA          preysOn              EOL:2620777
+## 5                         NA    interactsWith              EOL:2625033
+## 6                         NA          preysOn              EOL:2620777
 ##   target_taxon_name
 ## 1          Copepoda
-## 2           Balanus
+## 2        Gammaridea
 ## 3          Copepoda
-## 4         Oniscidea
-## 5        Gammaridea
-## 6          Copepoda
-##                                                                                                                                                         target_taxon_path
-## 1                                                                        Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
-## 2 Biota | Animalia | Arthropoda | Crustacea | Maxillopoda | Thecostraca | Cirripedia | Thoracica | Sessilia | Balanomorpha | Balanoidea | Balanidae | Balaninae | Balanus
-## 3                                                                        Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
-## 4                              Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Isopoda | Oniscidea
-## 5                           Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea
-## 6                                                                        Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
+## 4        Gammaridea
+## 5          Copepoda
+## 6        Gammaridea
+##                                                                                                                               target_taxon_path
+## 1                                              Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
+## 2 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea
+## 3                                              Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
+## 4 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea
+## 5                                              Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Maxillopoda | Copepoda
+## 6 Animalia | Bilateria | Protostomia | Ecdysozoa | Arthropoda | Crustacea | Malacostraca | Eumalacostraca | Peracarida | Amphipoda | Gammaridea
 ##   target_specimen_life_stage latitude longitude study_title
 ## 1                         NA       NA        NA          NA
 ## 2                         NA       NA        NA          NA
@@ -433,17 +287,20 @@ 

Find interactions involving a certain species

## 4 NA NA NA NA ## 5 NA NA NA NA ## 6 NA NA NA NA -
+``` + +#### Find interactions in a geographic areas -

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](http://spatialreference.org/ref/epsg/wgs-84/)) and correspond to the west, south, east, and northern boundaries (i.e., min x, min y, max x, max y). -

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))
+```r
+gulfinteractions <- get_interactions_in_area( bbox=c(-97.0, 17.5, -81, 31))
 head(gulfinteractions)
-
+``` -
##   source_taxon_external_id        source_taxon_name
+```
+##   source_taxon_external_id        source_taxon_name
 ## 1                    EOL:1                 Animalia
 ## 2                 EOL:1905           Actinopterygii
 ## 3              EOL:2598871                Crustacea
@@ -485,45 +342,53 @@ 

Find interactions in a geographic areas

## 4 NA NA NA NA ## 5 NA NA NA NA ## 6 NA NA NA NA -
- -

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

- -
areas <- get_interaction_areas()
-head(areas)
-
+``` -
##   Latitude Longitude
-## 1    29.35    -92.98
-## 2    29.03    -92.29
-## 3    28.04    -96.11
-## 4    27.62    -95.77
-## 5    26.33    -96.03
-## 6    30.14    -86.17
-
+To see all locations for which interactions have entered in GloBi, -

You can also restrict this search to a certain area:

-
areas <- get_interaction_areas (bbox=c(-67.87,12.79,-57.08,23.32))
+```r
+areas <- get_interaction_areas()
 head(areas)
-
+``` + +``` +## Latitude Longitude +## 1 29.34695 -92.98061 +## 2 29.03260 -92.28701 +## 3 28.03673 -96.11108 +## 4 27.62409 -95.77403 +## 5 26.33146 -96.03294 +## 6 30.25024 -86.13114 +``` +You can also restrict this search to a certain area: + + +```r +areas <- get_interaction_areas (bbox=c(-67.87,12.79,-57.08,23.32)) +head(areas) +``` + +``` +## Latitude Longitude +## 1251 18.24829 -66.49989 +## 1255 18.33884 -65.82572 +## 1268 18.06667 -63.06667 +## 1339 13.16667 -59.53333 +``` -
##      Latitude Longitude
-## 1251    18.25    -66.50
-## 1255    18.34    -65.83
-## 1268    18.07    -63.07
-## 1339    13.17    -59.53
-
+#### Custom Queries using Cypher -

Custom Queries using Cypher

+Currently, GloBI is powered by [neo4j](http://neo4j.org), a graph database. Most results created by the R functions provided by `rglobi` are basically wrappers for commonly used cypher queries. This way, you can still use the library without having to learn Cypher, a graph query language. However, if you feel adventurous, you can execute queries using Cypher only using the function `query()`: -

Currently, GloBI is powered by neo4j, a graph database. Most results created by the R functions provided by rglobi are basically wrappers for commonly used cypher queries. This way, you can still use the library without having to learn Cypher, a graph query language. However, if you feel adventurous, you can execute queries using Cypher only using the function query():

-
result <- query("START taxon = node:taxons(name='Homo sapiens') MATCH taxon<-[:CLASSIFIED_AS]-predator-[:ATE|PREYS_ON]->prey-[:CLASSIFIED_AS]->preyTaxon RETURN distinct(preyTaxon.name) as `prey.taxon.name` LIMIT 10")
+```r
+result <- query("START taxon = node:taxons(name='Homo sapiens') MATCH taxon<-[:CLASSIFIED_AS]-predator-[:ATE|PREYS_ON]->prey-[:CLASSIFIED_AS]->preyTaxon RETURN distinct(preyTaxon.name) as `prey.taxon.name` LIMIT 10")
 result
-
+``` -
##         prey.taxon.name
+```
+##         prey.taxon.name
 ## 1          Homo sapiens
 ## 2    Macropus bernardus
 ## 3             Mysticeti
@@ -534,10 +399,6 @@ 

Custom Queries using Cypher

## 8 Lophocebus albigena ## 9 Salmonidae ## 10 Moschus chrysogaster -
- -

This particular query returns the names of the first ten known prey or diet items of humans (Homo sapiens). More examples of GloBI specific Cypher queries can be found on the GloBI Cypher Wiki.

- - +``` - +This particular query returns the names of the first ten known prey or diet items of humans (_Homo sapiens_). More examples of GloBI specific Cypher queries can be found on the [GloBI Cypher Wiki](https://github.com/jhpoelen/eol-globi-data/wiki/cypher).