taxizedb-package: Taxonomic databases interface

Description Database setup/user/pwd Author(s) Examples

Description

Taxonomic databases interface

Database setup/user/pwd

Every user will have a unique combination of username, password, and platform, so we can't make the functions in this package work out of the box in every situation.

Author(s)

Scott Chamberlain [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## Not run: 
# IMPORTANT: Remember to start your PostgreSQL database for ITIS
# and ThePlantList and your MySQL database for COL

# data source: ITIS
## download ITIS database
x <- db_download_itis()
db_load_itis(x)

## connect to the ITIS database
src <- src_itis()

## use SQL syntax
sql_collect(src, "select * from hierarchy limit 5")
### or pipe the src to sql_collect
src %>% sql_collect("select * from hierarchy limit 5")

## use dplyr verbs
src %>%
  tbl("hierarchy") %>%
  top_n(10)

## or create tbl object for repeated use
hiers <- src %>% tbl("hierarchy")
hiers %>% top_n(10)
hiers %>% select(tsn, level)


# data source: theplantlist
## download tpl datababase
x <- db_download_tpl()
db_load_tpl(x)

## connecto the tpl database
src <- src_tpl()

## do queries
tpl <- src %>% tbl("plantlist")
tpl %>% filter(family == "Pinaceae")

# data source: catalogue of life
## download col datababase
x <- db_download_col()
db_load_col(x)

## connecto the col database
src <- src_col()

## do queries
cnames <- src %>% tbl("common_name_element")
cnames %>% select(name)

## End(Not run)

taxizedb documentation built on May 2, 2019, 11:41 a.m.