Skip to content

Commit 6438f8a

Browse files
authored
Merge pull request #97 from stitam/dev
Update documentation
2 parents ee14803 + 00b58e3 commit 6438f8a

23 files changed

Lines changed: 83 additions & 88 deletions

‎DESCRIPTION‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: taxizedb
22
Type: Package
33
Title: Offline Access to Taxonomic Databases
4-
Description: Download taxonomic databases such as CoL, GBIF, ITIS, NCBI, WFO, or
5-
Wikidata, convert them into SQLite format, and query them locally for fast,
6-
reliable, and reproducible access to taxonomic data.
4+
Description: Download taxonomic databases, convert them into 'SQLite' format,
5+
and query them locally for fast, reliable, and reproducible access to
6+
taxonomic data.
77
Version: 0.3.2
88
Authors@R: c(
99
person("Scott", "Chamberlain", role = "aut"),

‎NAMESPACE‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export("%>%")
43
export(children)
54
export(classification)
65
export(db_download_col)

‎R/ap_children.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ gbif_children <- function(src, x, ...){
8989
stats::setNames(lapply(x, FUN, src = src), x)
9090
}
9191

92+
#' @importFrom magrittr %>%
9293
ncbi_children <- function(src, x, ...){
9394

9495
FUN <- function(src, x, ambiguous=FALSE, ...){

‎R/ap_classification.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ gbif_classification <- function(src, x, ...) {
162162
stats::setNames(lapply(x, FUN, src = src), x)
163163
}
164164

165+
#' @importFrom magrittr %>%
165166
ncbi_classification <- function(src, x, ...){
166167

167168
FUN <- function(src, x, ...){

‎R/ap_core.R‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# c("Arabidopsis", "Peridermium sp. 'Ysgr-4'") -> "'Arabidopsis',
55
# 'Peridermium sp. ''Ysgr-4'''"
66
# Note that double quoting is the SQL convention for escaping quotes in strings
7+
#' @importFrom magrittr %>%
78
sql_character_list <- function(x){
89
if(any(is.na(x))){
910
stop("Cannot pass NA into SQL query")
@@ -73,6 +74,7 @@ run_with_db <- function(FUN, db, ...) {
7374
FUN(src, ...)
7475
}
7576

77+
#' @importFrom magrittr %>%
7678
ncbi_apply <- function(src, x, FUN, missing=NA, die_if_ambiguous=TRUE, ...){
7779
# preserve original names (this is important when x is a name vector)
7880
namemap <- x

‎R/ap_downstream.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ gbif_downstream <- function(src, x, ...){
255255
stats::setNames(lapply(x, FUN, src = src, ...), x)
256256
}
257257

258+
#' @importFrom magrittr %>%
258259
ncbi_downstream <- function(src, x, ...){
259260

260261
FUN <- function(

‎R/caching.R‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#'
55
#' @export
66
#' @name tdb_cache
7+
#'
8+
#' @return An object of classes `HoardClient` and `R6`.
79
#'
810
#' @details `cache_delete` only accepts 1 file name, while
911
#' `cache_delete_all` doesn't accept any names, but deletes all files.

‎R/db_download.R‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,36 @@
1212
#' sqlite database you can still use the rest of the TPL functions with it. We
1313
#' suggest using the World Flora Online (WFO) database as a replacement.
1414
#' @seealso [tdb_cache]
15-
#' @examples \dontrun{
15+
#' @examples
16+
#' \dontrun{
1617
#' # ITIS
17-
#' # db_download_itis()
18-
#' # src_itis()
18+
#' db_download_itis()
19+
#' src_itis()
1920
#'
2021
#' # Plantlist
21-
#' # db_download_tpl()
22-
#' # src_tpl()
22+
#' db_download_tpl()
23+
#' src_tpl()
2324
#'
2425
#' # COL
25-
#' # db_download_col()
26-
#' # src_col()
26+
#' db_download_col()
27+
#' src_col()
2728
#'
2829
#' # GBIF
29-
#' # db_download_gbif()
30-
#' # src_gbif()
30+
#' db_download_gbif()
31+
#' src_gbif()
3132
#'
3233
#' # NCBI
33-
#' # db_download_ncbi()
34-
#' # src_ncbi()
34+
#' db_download_ncbi()
35+
#' src_ncbi()
3536
#'
3637
#' # Wikidata
37-
#' # db_download_wikidata()
38-
#' # db_download_wikidata(overwrite=TRUE) # overwrite - download again
39-
#' # src_wikidata()
38+
#' db_download_wikidata()
39+
#' db_download_wikidata(overwrite=TRUE) # overwrite - download again
40+
#' src_wikidata()
4041
#'
4142
#' # World Flora Online
42-
#' # db_download_wfo()
43-
#' # src_wfo()
43+
#' db_download_wfo()
44+
#' src_wfo()
4445
#' }
4546

4647
#' @export
@@ -127,7 +128,7 @@ db_download_ncbi <- function(verbose = TRUE, overwrite = FALSE) {
127128
hierarchs <- list()
128129
# set up the base table with columns 'tax_id', 'ancestor', and 'level', where
129130
# level is 1 for immediate parent
130-
hierarchs[[1]] <- ncbi_nodes[, c('tax_id', 'parent_tax_id')] %>%
131+
hierarchs[[1]] <- ncbi_nodes[, c('tax_id', 'parent_tax_id')] |>
131132
magrittr::set_names(c('tax_id', 'ancestor'))
132133
hierarchs[[1]]$level <- 1
133134
# make a child to parent map

‎R/db_load.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#'
66
#' @export
77
#' @param ... ignored
8+
#' @return An error message.
89
#' @name db_load-defunct
910

1011
#' @export

‎R/pipe.R‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)