Skip to content

Commit

Permalink
update vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Sep 22, 2017
1 parent 14a888a commit dd49d77
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 1,071 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.Rproj.user
plantatt.pdf
inst/PLANTATT_19_Nov_08/*
inst/vign/vigncache
56 changes: 16 additions & 40 deletions inst/vign/betydb.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ out %>%
```

```
## Source: local data frame [509 x 2]
##
## # A tibble: 449 x 2
## id mean_result
## 1 1666 27.36
## 2 16845 27.00
## 3 1669 26.36
## 4 16518 26.00
## 5 1663 25.35
## 6 16742 25.00
## 7 1594 24.78
## 8 1674 22.71
## 9 1606 22.54
## <int> <dbl>
## 1 1666 27.36
## 2 16845 27.00
## 3 1669 26.36
## 4 16518 26.00
## 5 1663 25.35
## 6 16742 25.00
## 7 1594 24.78
## 8 1674 22.71
## 9 1606 22.54
## 10 1665 22.46
## .. ... ...
## # ... with 439 more rows
```

Single trait
Expand All @@ -64,18 +64,12 @@ betydb_trait(id = 10)
```

```
## $created_at
## NULL
##
## $description
## [1] "Leaf Percent Nitrogen"
##
## $id
## [1] 10
##
## $label
## NULL
##
## $max
## [1] "10"
##
Expand All @@ -88,12 +82,6 @@ betydb_trait(id = 10)
## $notes
## [1] ""
##
## $standard_name
## NULL
##
## $standard_units
## NULL
##
## $units
## [1] "percent"
##
Expand All @@ -111,15 +99,12 @@ betydb_specie(id = 10)
```

```
## $AcceptedSymbol
## $acceptedsymbol
## [1] "ACKA2"
##
## $commonname
## [1] "karroothorn"
##
## $created_at
## NULL
##
## $genus
## [1] "Acacia"
##
Expand All @@ -132,9 +117,6 @@ betydb_specie(id = 10)
## $scientificname
## [1] "Acacia karroo"
##
## $spcd
## NULL
##
## $species
## [1] "karroo"
##
Expand All @@ -155,9 +137,6 @@ betydb_citation(10)
## $author
## [1] "Casler"
##
## $created_at
## NULL
##
## $doi
## [1] "10.2135/cropsci2003.2226"
##
Expand All @@ -176,15 +155,9 @@ betydb_citation(10)
## $title
## [1] "Cultivar X environment interactions in switchgrass"
##
## $updated_at
## NULL
##
## $url
## [1] "http://crop.scijournals.org/cgi/content/abstract/43/6/2226"
##
## $user_id
## NULL
##
## $vol
## [1] 43
##
Expand Down Expand Up @@ -222,4 +195,7 @@ betydb_site(id = 1)
##
## $state
## [1] ""
##
## $time_zone
## [1] "Europe/Athens"
```
75 changes: 11 additions & 64 deletions inst/vign/traits_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Get trait data for Willow (_Salix_ spp.)

```{r}
(salix <- betydb_search("Salix Vcmax"))
# equivalent:
# equivalent:
# (out <- betydb_search("willow"))
```

Expand All @@ -50,7 +50,7 @@ salix %>%
Get sequences by id

```{r}
ncbi_byid(ids = "360040093", format = "fasta")
ncbi_byid(ids = "360040093")
```

Get sequences searching by taxonomic name
Expand All @@ -60,69 +60,35 @@ out <- ncbi_searcher(taxa = "Umbra limi", seqrange = "1:2000")
head(out)
```

## GISD invasive species data

```{r}
sp <- c("Carpobrotus edulis", "Rosmarinus officinalis")
g_invasive(sp)
```

Or as simplified output

```{r}
g_invasive(sp, simplify = TRUE)
```

## EOL invasive species data

```{r}
eol_invasive_('Brassica oleracea', dataset = 'gisd')
```

Another example, with more species, and from

```{r}
eol_invasive_(c('Lymantria dispar','Cygnus olor','Hydrilla verticillata','Pinus concolor'),
dataset = 'i3n')
```

## EOL's traitbank trait data

Searching for _Mesoplodon bidens_, page id `328566`
Searching for _Balaenoptera musculus_ (blue whale), page id `328574`

```{r cache=TRUE}
res <- traitbank(trait = 328566)
res$graph %>%
select(dwc.measurementtype..id, dwc.measurementtype.rdfs.label.en, dwc.measurementvalue) %>%
filter(!is.na(dwc.measurementvalue))
```{r}
res <- traitbank(328574)
res$graph %>%
select(`dwc:measurementtype`) %>%
filter(!is.na(`dwc:measurementtype`))
```

## Coral

Get the species list and their ids

```{r cache=TRUE}
```{r}
coral_species()
```

Get data by taxon

```{r cache=TRUE}
```{r}
coral_taxa(80)
```

Get data by trait

```{r cache=TRUE}
coral_traits(105)
```

## Flora Europaea

```{r}
sp <- c("Lavandula stoechas", "Carpobrotus edulis", "Rhododendron ponticum",
"Alkanna lutea", "Anchusa arvensis")
sapply(sp, fe_native, simplify = FALSE)
coral_traits(105)
```

## Birdlife International
Expand All @@ -138,22 +104,3 @@ Threats data
```{r}
birdlife_threats(22721692)
```

## Nativity

```{r}
sp <- c("Lavandula stoechas", "Carpobrotus edulis", "Rhododendron ponticum",
"Alkanna lutea", "Anchusa arvensis")
```

Native in the continental USA?

```{r}
sapply(sp, is_native, where = "Continental US", region = "america")
```

Native on Islas Baleares?

```{r}
sapply(sp, is_native, where = "Islas_Baleares", region = "europe")
```
Loading

0 comments on commit dd49d77

Please sign in to comment.