-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added vignettes to vignettes folder from inst/vign
- Loading branch information
Showing
99 changed files
with
2,250 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
all: move pandoc rmd2md | ||
|
||
vignettes: | ||
cd inst/vign;\ | ||
Rscript -e 'library(knitr); knit("rgbif_vignette.Rmd"); knit("rgbif_vignette.Rmd")' | ||
Rscript -e 'library(knitr); knit("rgbif_vignette_oldapi.Rmd"); knit("rgbif_vignette_oldapi.Rmd")' | ||
|
||
move: | ||
cp inst/vign/rgbif_vignette.md vignettes;\ | ||
cp inst/vign/rgbif_vignette_oldapi.md vignettes;\ | ||
cp -r inst/vign/figure/ vignettes/figure/ | ||
|
||
pandoc: | ||
cd vignettes;\ | ||
pandoc -H margins.sty rgbif_vignette.md -o rgbif_vignette.html;\ | ||
pandoc -H margins.sty rgbif_vignette.md -o rgbif_vignette.pdf;\ | ||
pandoc -H margins.sty rgbif_vignette_oldapi.md -o rgbif_vignette_oldapi.html;\ | ||
pandoc -H margins.sty rgbif_vignette_oldapi.md -o rgbif_vignette_oldapi.pdf | ||
|
||
rmd2md: | ||
cd vignettes;\ | ||
cp rgbif_vignette.md rgbif_vignette.Rmd;\ | ||
cp rgbif_vignette_oldapi.md rgbif_vignette_oldapi.Rmd | ||
|
||
cleanup: | ||
cd inst/vign;\ | ||
rm rgbif_vignette.md rgbif_vignette_oldapi.md | ||
rm -r vignettes/figure/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
base | ||
bitops | ||
ggplot2 | ||
knitr | ||
maps | ||
plyr | ||
RCurl | ||
rgbif | ||
rjson | ||
XML |
Binary file added
BIN
+202 Bytes
inst/vign/cache/densitylist2_0ce0b01c45b7654fc4dbd796bf183487.RData
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file added
BIN
+221 Bytes
inst/vign/cache/occurrencecount1_66cdd00bd9d444957202ff9f3ee654cd.RData
Binary file not shown.
Empty file.
Binary file added
BIN
+113 Bytes
inst/vign/cache/occurrencecount1_66cdd00bd9d444957202ff9f3ee654cd.rdx
Binary file not shown.
Binary file added
BIN
+260 Bytes
inst/vign/cache/occurrencecount2_926bc15d2a10594ac3f337b094b83f81.RData
Binary file not shown.
Empty file.
Binary file added
BIN
+113 Bytes
inst/vign/cache/occurrencecount2_926bc15d2a10594ac3f337b094b83f81.rdx
Binary file not shown.
Binary file added
BIN
+624 Bytes
inst/vign/cache/occurrencelist_d807936aa17a8c7fedbb2948fd57ea85.RData
Binary file not shown.
Binary file added
BIN
+555 Bytes
inst/vign/cache/occurrencelist_d807936aa17a8c7fedbb2948fd57ea85.rdb
Binary file not shown.
Binary file added
BIN
+130 Bytes
inst/vign/cache/occurrencelist_d807936aa17a8c7fedbb2948fd57ea85.rdx
Binary file not shown.
Binary file added
BIN
+271 Bytes
inst/vign/cache/occurrencelist_many_c5ff927e03fafbc7890cccd423738810.RData
Binary file not shown.
Binary file added
BIN
+1.81 KB
inst/vign/cache/occurrencelist_many_c5ff927e03fafbc7890cccd423738810.rdb
Binary file not shown.
Binary file added
BIN
+143 Bytes
inst/vign/cache/occurrencelist_many_c5ff927e03fafbc7890cccd423738810.rdx
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<!-- | ||
%\VignetteEngine{knitr} | ||
%\VignetteIndexEntry{Tutorial for the new GBIF API} | ||
--> | ||
|
||
rgbif vignette - Seach and retrieve data from the Global Biodiverity Information Facilty (GBIF) | ||
====== | ||
|
||
## About the package | ||
|
||
`rgbif` is an R package to search and retrieve data from the Global Biodiverity Information Facilty (GBIF). `rgbif` wraps R code around the [GBIF API][gbifapi] to allow you to talk to GBIF from R. | ||
|
||
******************** | ||
|
||
## Install rgbif and dependencies | ||
|
||
```{r install, eval=FALSE} | ||
install.packages("rgbif") | ||
``` | ||
|
||
## Load rgbif and dependencies | ||
|
||
```{r load, comment=NA, warning=FALSE, message=FALSE} | ||
library(rgbif); library(XML); library(RCurl); library(plyr); library(ggplot2); library(maps) | ||
``` | ||
|
||
******************** | ||
|
||
## Get number of occurrences for a set of search parameters | ||
|
||
### Search by type of record, all observational in this case | ||
|
||
```{r occ_count1, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(basisOfRecord='OBSERVATION') | ||
``` | ||
|
||
### Records for **Puma concolor** with lat/long data (georeferened) only | ||
|
||
```{r occ_count2, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(nubKey=2435099, georeferenced=TRUE) | ||
``` | ||
|
||
### All georeferenced records in GBIF | ||
|
||
```{r occ_count3, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(georeferenced=TRUE) | ||
``` | ||
|
||
### Records from Denmark | ||
|
||
```{r occ_count4, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(country='DENMARK') | ||
``` | ||
|
||
### Records from France | ||
|
||
```{r occ_count5, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(hostCountry='FRANCE') | ||
``` | ||
|
||
### Number of records in a particular dataset | ||
|
||
```{r occ_count6, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(datasetKey='9e7ea106-0bf8-4087-bb61-dfe4f29e0f17') | ||
``` | ||
|
||
### All records from 2012 | ||
|
||
```{r occ_count7, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(year=2012) | ||
``` | ||
|
||
### Records for a particular dataset, and only for preserved specimens | ||
|
||
```{r occ_count8, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_count(datasetKey='8626bd3a-f762-11e1-a439-00145eb45e9a', basisOfRecord='PRESERVED_SPECIMEN') | ||
``` | ||
|
||
******************** | ||
|
||
## Get possible values to be used in taxonomic rank arguments in functions | ||
|
||
```{r taxrank, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
taxrank() | ||
``` | ||
|
||
******************** | ||
|
||
## Search for taxon information | ||
|
||
### Search for a genus | ||
|
||
```{r name_lookup1, comment=NA, warning=FALSE, message=FALSE} | ||
head(name_lookup(query='Cnaemidophorus', rank="genus", return="data")) | ||
``` | ||
|
||
### Search for the class mammalia | ||
|
||
```{r name_lookup2, comment=NA, warning=FALSE, message=FALSE} | ||
head(name_lookup(query='mammalia')$data) | ||
``` | ||
|
||
### Look up the species Helianthus annuus | ||
|
||
```{r name_lookup3, comment=NA, warning=FALSE, message=FALSE} | ||
head(name_lookup('Helianthus annuus', rank="species")$data) | ||
``` | ||
|
||
******************** | ||
|
||
## Get data for a single occurrence. Note that data is returned as a list, with slots for metadata and data, or as a hierarchy, or just data. | ||
|
||
### Just data | ||
|
||
```{r occ_get1, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_get(key=773433533, return='data') | ||
``` | ||
|
||
### Just taxonomic hierarchy | ||
|
||
```{r occ_get2, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_get(key=773433533, return='hier') | ||
``` | ||
|
||
### All data, or leave return parameter blank | ||
|
||
```{r occ_get3, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_get(key=773433533, return='all') | ||
``` | ||
|
||
### Get many occurrences. `occ_get` is vectorized | ||
|
||
```{r occ_get4, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
occ_get(key=c(773433533,101010,240713150,855998194,49819470), return='data') | ||
``` | ||
|
||
******************** | ||
|
||
## Maps | ||
|
||
### Static map using the ggplot2 package | ||
|
||
Make a map of **Puma concolor** occurrences | ||
|
||
```{r gbifmap1, comment=NA, warning=FALSE, message=FALSE, cache=TRUE} | ||
key <- name_backbone(name='Puma concolor', kingdom='plants')$speciesKey | ||
dat <- occ_search(taxonKey=key, return='data', limit=300, minimal=FALSE) | ||
gbifmap(input=dat) | ||
``` | ||
|
||
[gbifapi]: http://data.gbif.org/tutorial/services |
Oops, something went wrong.