ropensci / taxize
Showing 24 of 50 files from the diff.

@@ -3,7 +3,7 @@
Loading
3 3
#' THIS FUNCTION IS DEFUNCT.
4 4
#'
5 5
#' @export
6 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
6 +
#' @author Scott Chamberlain 
7 7
#' @rdname ncbi_getbyname-defunct
8 8
#' @keywords internal
9 9
ncbi_getbyname <- function(...) {

@@ -26,7 +26,7 @@
Loading
26 26
#' See [taxize-authentication] for help on authentication
27 27
#' 
28 28
#' @author Jimmy O'Donnell \email{jodonnellbio@@gmail.com}
29 -
#' Scott Chamberlain \email{myrmecocystus@@gmail.com}
29 +
#' Scott Chamberlain
30 30
#' @examples \dontrun{
31 31
#' id <- c("9031", "9823", "9606", "9470")
32 32
#' id_class <- classification(id, db = 'ncbi')

@@ -1,4 +1,4 @@
Loading
1 -
#' Retrieve all taxa names downstream in hierarchy for GBIF
1 +
#' Retrieve all taxonomic names downstream in hierarchy for GBIF
2 2
#'
3 3
#' @export
4 4
#' @param id A taxonomic serial number.
@@ -8,14 +8,16 @@
Loading
8 8
#' @param intermediate (logical) If TRUE, return a list of length two with
9 9
#' target taxon rank names, with additional list of data.frame's of
10 10
#' intermediate taxonomic groups. Default: FALSE
11 -
#' @param limit Number of records to return
12 -
#' @param start Record number to start at
11 +
#' @param limit Number of records to return. default: 100. max: 1000. use in
12 +
#' combination with the `start` parameter
13 +
#' @param start Record number to start at. default: 0. use in combination 
14 +
#' with the `limit` parameter
13 15
#' @param key Deprecated, see `id`
14 16
#' @param ... Further args passed on to [gbif_name_usage()]
15 17
#' @return data.frame of taxonomic information downstream to family from e.g.,
16 18
#' 		Order, Class, etc., or if `intermediated=TRUE`, list of length two,
17 19
#'   	with target taxon rank names, and intermediate names.
18 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
20 +
#' @author Scott Chamberlain
19 21
#' @details Sometimes records don't have a `canonicalName` entry which is 
20 22
#' what we look for. In that case we grab the `scientificName` entry. 
21 23
#' You can see the type of name colleceted in the column `name_type`
@@ -28,7 +30,8 @@
Loading
28 30
#' gbif_downstream(id = 1227, "family")
29 31
#' ## here, intermediate leads to the same result as the target
30 32
#' gbif_downstream(id = 1227, "family", intermediate=TRUE)
31 -
#'
33 +
#' 
34 +
#' if (interactive()) {
32 35
#' # Lepidoptera
33 36
#' gbif_downstream(id = 797, "family")
34 37
#'
@@ -44,6 +47,20 @@
Loading
44 47
#' key <- 2925668
45 48
#' res <- gbif_downstream(key, downto = "species")
46 49
#' res2 <- downstream(key, db = "gbif", downto = "species")
50 +
#' 
51 +
#' # Pagination
52 +
#' # GBIF limits queries to a maximum of 1000 records per request, so if
53 +
#' # there's more than 1000, use the start parameter
54 +
#' # Piper, taxonKey = 3075433
55 +
#' x1 <- gbif_downstream(id = 3075433, downto = "species", limit=1000)
56 +
#' x2 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
57 +
#'   start=1000)
58 +
#' x3 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
59 +
#'   start=2000)
60 +
#' x4 <- gbif_downstream(id = 3075433, downto = "species", limit=1000,
61 +
#'   start=3000)
62 +
#' rbind(x1, x2, x3, x4)
63 +
#' }
47 64
#' }
48 65
49 66
gbif_downstream <- function(id, downto, intermediate = FALSE, limit = 100,

@@ -34,7 +34,7 @@
Loading
34 34
#' @family taxonomic-ids
35 35
#' @seealso [classification()]
36 36
#'
37 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
37 +
#' @author Scott Chamberlain
38 38
#'
39 39
#' @details EOL is a bit odd in that they have page IDs for each taxon, but
40 40
#' then within that, they have taxon ids for various taxa within that page

@@ -24,7 +24,7 @@
Loading
24 24
#' @param ... Curl options passed on to `httr::POST` within
25 25
#' [rotl::tnrs_match_names()]
26 26
#' @author Francois Michonneau \email{francois.michonneau@@gmail.com}
27 -
#' Scott Chamberlain \email{myrmecocystus@@gmail.com}
27 +
#' Scott Chamberlain
28 28
#' @seealso [gnr_resolve()], [tnrs()]
29 29
#' @references
30 30
#' https://github.com/OpenTreeOfLife/germinator/wiki/TNRS-API-v3#match_names

@@ -32,9 +32,7 @@
Loading
32 32
#'
33 33
#' @family taxonomic-ids
34 34
#' @seealso [classification()]
35 -
#'
36 35
#' @author Scott Chamberlain
37 -
#'
38 36
#' @examples \dontrun{
39 37
#' get_tps(sci='Poa annua')
40 38
#' get_tps(sci='Pinus contorta')

@@ -9,7 +9,7 @@
Loading
9 9
#' @param size (integer/numeric) Number of names to get. Maximum depends on
10 10
#' the rank
11 11
#' @return character vector of taxonomic names
12 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
12 +
#' @author Scott Chamberlain 
13 13
#' @examples
14 14
#' names_list()
15 15
#' names_list('species')

@@ -32,7 +32,7 @@
Loading
32 32
#' @family nbn
33 33
#' @seealso [classification()]
34 34
#'
35 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
35 +
#' @author Scott Chamberlain, 
36 36
#'
37 37
#' @examples \dontrun{
38 38
#' get_nbn(sci_com='Poa annua')

@@ -3,7 +3,7 @@
Loading
3 3
#' THIS FUNCTION IS DEFUNCT.
4 4
#'
5 5
#' @export
6 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
6 +
#' @author Scott Chamberlain
7 7
#' @rdname ncbi_getbyid-defunct
8 8
#' @keywords internal
9 9
ncbi_getbyid <- function(...) {

@@ -30,7 +30,7 @@
Loading
30 30
#' names. Default: `FALSE`
31 31
#' @param search_term Deprecated, see `sci`
32 32
#' @param ... Curl options passed on to [crul::verb-GET]
33 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
33 +
#' @author Scott Chamberlain
34 34
#' @return data.frame of results.
35 35
#' @seealso [gnr_datasources()], [gni_search()]
36 36
#' @keywords globalnamesindex names taxonomy

@@ -9,7 +9,7 @@
Loading
9 9
#' @param ... Curl options passed on to [crul::HttpClient]
10 10
#' @return A named list (names are input taxa names) of one or more IUCN IDs.
11 11
#' Taxa that aren't found are silently dropped.
12 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
12 +
#' @author Scott Chamberlain, 
13 13
#' @examples \dontrun{
14 14
#' iucn_id("Branta canadensis")
15 15
#' iucn_id("Branta bernicla")

@@ -7,7 +7,7 @@
Loading
7 7
#' @param all_records If all_records is 1, GNI returns all records from all
8 8
#' 		repositories for the name string (takes 0, or 1 \[default\]).
9 9
#' @param ... Curl options passed on to [crul::verb-GET]
10 -
#' @author Scott Chamberlain {myrmecocystus@@gmail.com}
10 +
#' @author Scott Chamberlain
11 11
#' @return Data.frame of results.
12 12
#' @seealso [gnr_datasources()], [gni_search()].
13 13
#' @keywords globalnamesindex names taxonomy

@@ -44,7 +44,7 @@
Loading
44 44
#'
45 45
#' @author Eduard Szoecs, \email{eduardszoecs@@gmail.com}
46 46
#' @author Philippe Marchand, \email{marchand.philippe@@gmail.com}
47 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
47 +
#' @author Scott Chamberlain, 
48 48
#'
49 49
#' @section Redlist Authentication:
50 50
#' `iucn_summary` uses the new Redlist API for searching for a IUCN ID, so we

@@ -10,7 +10,7 @@
Loading
10 10
#' @param ... Further args passed on to [crul::HttpClient].
11 11
#' @return a list with slots for metadata (`meta`) with list of response
12 12
#' attributes, and data (`data`) with a data.frame of results
13 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
13 +
#' @author Scott Chamberlain, 
14 14
#' @references http://powo.science.kew.org/
15 15
#' @family pow
16 16
#' @examples \dontrun{

@@ -30,7 +30,7 @@
Loading
30 30
#' @family taxonomic-ids
31 31
#' @seealso [classification()]
32 32
#'
33 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
33 +
#' @author Scott Chamberlain, 
34 34
#'
35 35
#' @details Internally in this function we use a function to search GBIF's taxonomy,
36 36
#' and if we find an exact match we return the ID for that match. If there isn't an

@@ -29,7 +29,7 @@
Loading
29 29
#'
30 30
#' @seealso [comm2sci()]
31 31
#'
32 -
#' @author Scott Chamberlain (myrmecocystus@@gmail.com)
32 +
#' @author Scott Chamberlain
33 33
#'
34 34
#' @examples \dontrun{
35 35
#' sci2comm(sci='Helianthus annuus')

@@ -7,7 +7,7 @@
Loading
7 7
#' @param raw (logical) If TRUE, raw json or xml returned, if FALSE, parsed
8 8
#' data returned.
9 9
#' @param ... (list) Further args passed on to [crul::verb-GET]
10 -
#' @author Scott Chamberlain {myrmecocystus@@gmail.com}
10 +
#' @author Scott Chamberlain
11 11
#' @return json, xml or a list.
12 12
#' @references API docs https://data.canadensys.net/vascan/api
13 13
#' @keywords names taxonomy

@@ -42,7 +42,7 @@
Loading
42 42
                "44f1a53227f1c0b6238a997fcfe7513415f948d2")
43 43
      names(keys) <- keynames[1:2]
44 44
      key <- keys[[service]]
45 -
      key_helpers <- c("taxize::use_tropicos()")
45 +
      key_helpers <- c("taxize::use_tropicos()", "taxize::use_iucn()")
46 46
      names(key_helpers) <- keynames[1:2]
47 47
      message(paste("Using default key: Please get your own API key via ",
48 48
                    key_helpers[service], sep = ""))

@@ -17,7 +17,7 @@
Loading
17 17
#' @family nbn
18 18
#' @return a list with slots for metadata (`meta`) with list of response
19 19
#' attributes, and data (`data`) with a data.frame of results
20 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
20 +
#' @author Scott Chamberlain, 
21 21
#' @references https://api.nbnatlas.org/
22 22
#'
23 23
#' @examples \dontrun{

@@ -30,7 +30,7 @@
Loading
30 30
#' @param return_content (logical) return OCR'ed text. returns text
31 31
#' string in `x$meta$content` slot. Default: `FALSE`
32 32
#' @param ... Further args passed to [crul::verb-GET]
33 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
33 +
#' @author Scott Chamberlain 
34 34
#' @return A list of length two, first is metadata, second is the data as a
35 35
#' data.frame.
36 36
#' @details One of url, file, or text must be specified - and only one of them.

@@ -6,7 +6,7 @@
Loading
6 6
#' @param ... Further args passed on to [crul::verb-GET]
7 7
#' @return A data.frame
8 8
#' @family nbn
9 -
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
9 +
#' @author Scott Chamberlain, 
10 10
#' @references https://api.nbnatlas.org/
11 11
#' @examples \dontrun{
12 12
#' nbn_classification(id="NHMSYS0000376773")

@@ -30,6 +30,10 @@
Loading
30 30
#' @param rows (numeric) Any number from 1 to infinity. If the default NA, all
31 31
#' rows are considered. Note that this parameter is ignored if you pass in a
32 32
#' taxonomic id of any of the acceptable classes: tsn.
33 +
#' @param limit Number of records to return. Applies to gbif only.
34 +
#' default: 100. max: 1000. use in combination with the `start` parameter
35 +
#' @param start Record number to start at. Applies to gbif only. default: 0.
36 +
#' use in combination with the `limit` parameter
33 37
#' @param x Deprecated, see `sci_id`
34 38
#' @param ... Further args passed on to [itis_downstream()],
35 39
#' [gbif_downstream()], [ncbi_downstream()],
@@ -56,6 +60,8 @@
Loading
56 60
#' # Plug in taxon IDs
57 61
#' downstream(125732, db = 'worms', downto = 'species')
58 62
#' downstream(3451, db = 'bold', downto = 'species')
63 +
#' 
64 +
#' if (interactive()) {
59 65
#'
60 66
#' # Plug in taxon names
61 67
#' downstream("Apis", db = 'ncbi', downto = 'species')
@@ -91,7 +97,20 @@
Loading
91 97
#'
92 98
#' # use curl options
93 99
#' res <- downstream("Apis", db = 'gbif', downto = 'species', verbose = TRUE)
94 -
#' }
100 +
#' 
101 +
#' # Pagination
102 +
#' # GBIF limits queries to a maximum of 1000 records per request, so if
103 +
#' # there's more than 1000, use the start parameter
104 +
#' # Piper, taxonKey = 3075433
105 +
#' z1 <- downstream(3075433, db = 'gbif', downto = "species", limit=1000)
106 +
#' z2 <- downstream(3075433, db = 'gbif', downto = "species", limit=1000,
107 +
#'   start=1000)
108 +
#' z3 <- downstream(3075433, db = 'gbif', downto = "species", limit=1000,
109 +
#'   start=2000)
110 +
#' z4 <- downstream(3075433, db = 'gbif', downto = "species", limit=1000,
111 +
#'   start=3000)
112 +
#' NROW(rbind(z1[[1]], z2[[1]], z3[[1]], z4[[1]]))
113 +
#' }}
95 114
downstream <- function(...){
96 115
  UseMethod("downstream")
97 116
}

@@ -12,7 +12,7 @@
Loading
12 12
#' @return Data.frame of taxonomic information downstream to family from e.g.,
13 13
#' 		Order, Class, etc., or if `intermediate=TRUE`, list of length two,
14 14
#'   	with target taxon rank names, and intermediate names.
15 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
15 +
#' @author Scott Chamberlain
16 16
#' @section No Rank:
17 17
#' A sticky point with NCBI is that they can have designation for taxonomic
18 18
#' rank of "No Rank". So we have no way of programatically knowing what to

@@ -40,7 +40,7 @@
Loading
40 40
#' @param fields (character) One of minimal (default) or all. Minimal gives
41 41
#' back just four fields, whereas all gives all fields back.
42 42
#'
43 -
#' @author Scott Chamberlain \email{myrmecocystus@@gmail.com}
43 +
#' @author Scott Chamberlain 
44 44
#' @return A data.frame with one attribute `not_known`: a character
45 45
#' vector of taxa unknown to the Global Names Index. Access like
46 46
#' `attr(output, "not_known")`, or `attributes(output)$not_known`.
Files Coverage
R 62.58%
Project Totals (131 files) 62.58%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading