diff --git a/NAMESPACE b/NAMESPACE index 07c28a64..9b0c52ac 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -243,10 +243,11 @@ export(get_wormsid) export(get_wormsid_) export(getkey) export(gisd_isinvasive) -export(gn_parse) +export(gna_parse) +export(gna_search) export(gni_details) export(gni_parse) -export(gni_search) +export(gni_seach) export(gnr_datasources) export(gnr_resolve) export(id2name) diff --git a/R/gbif_parse.R b/R/gbif_parse.R index a2fcdccf..875731f6 100644 --- a/R/gbif_parse.R +++ b/R/gbif_parse.R @@ -8,7 +8,7 @@ #' all species names in `scientificname`. #' @author John Baumgartner \email{johnbb@@student.unimelb.edu.au} #' @references https://www.gbif.org/tools/name-parser/about -#' @seealso [gni_parse()], [gn_parse()] +#' @seealso [gni_parse()], [gna_parse()] #' @examples \dontrun{ #' gbif_parse(scientificname='x Agropogon littoralis') #' gbif_parse(c('Arrhenatherum elatius var. elatius', diff --git a/R/gn_parse.R b/R/gna_parse.R similarity index 53% rename from R/gn_parse.R rename to R/gna_parse.R index 4818ada4..a7304da7 100644 --- a/R/gn_parse.R +++ b/R/gna_parse.R @@ -8,43 +8,53 @@ #' @seealso [gbif_parse()], [gni_parse()] #' @references http://gni.globalnames.org/ #' @examples \dontrun{ -#' gn_parse("Cyanistes caeruleus") -#' gn_parse("Plantago minor") -#' gn_parse("Plantago minor minor") -#' gn_parse(c("Plantago minor minor","Helianthus annuus texanus")) +#' gna_parse("Cyanistes caeruleus") +#' gna_parse("Plantago minor") +#' gna_parse("Plantago minor minor") +#' gna_parse(c("Plantago minor minor","Helianthus annuus texanus")) #' #' # if > 20 names, uses an HTTP POST request #' x <- names_list("species", size = 30) -#' gn_parse(x) +#' gna_parse(x) #' #' # pass on curl options -#' gn_parse("Cyanistes caeruleus", verbose = TRUE) +#' gna_parse("Cyanistes caeruleus", verbose = TRUE) #' } -gn_parse <- function(names, ...) { +gna_parse <- function(names, ...) { assert(names, "character") method <- ifelse(length(names) <= 20, "get", "post") - tmp <- gn_http(method, names, ...) + tmp <- gna_http(method, names, ...) out <- jsonlite::fromJSON(tmp) out[paste0('canonical_', colnames(out$canonical))] <- out$canonical out$canonical <- NULL tibble::as_tibble(out) } -gn_http <- function(method, names, ...) { - cli <- crul::HttpClient$new("https://parser.globalnames.org", +gna_http <- function(method, names, ...) { + cli <- crul::HttpClient$new("https://parser.globalnames.org/api/v1/", headers = tx_ual, opts = list(...)) res <- switch(method, get = { - names <- paste0(names, collapse = "|") - # args <- list(q = names) - cli$get(paste0("api/v1/", names)) + cli$get(paste0('api/v1/', paste0(names, collapse = "|"))) }, post = { cli$headers <- c(cli$headers, list(`Content-Type` = "application/json", - Accept = "application/json")) - cli$post("api", body = jsonlite::toJSON(names)) + accept = "application/json")) + cli$post(body = jsonlite::toJSON(list(names = names))) } ) res$raise_for_status() res$parse("UTF-8") } + + +#' Parse scientific names using EOL's name parser. +#' +#' THIS FUNCTION IS DEFUNCT. +#' +#' @export +#' @keywords internal +gni_parse <- function(names, ...) { + .Defunct("ncbi_searcher", "traits", + msg = "This function is defunct. See gna_parse()") +} diff --git a/R/gna_search.R b/R/gna_search.R new file mode 100644 index 00000000..bb76da94 --- /dev/null +++ b/R/gna_search.R @@ -0,0 +1,80 @@ +#' @title Search for taxonomic names using the Global Names Architecture +#' +#' @description Uses the Global Names Index, see http://gni.globalnames.org +#' +#' @export +#' @param sci (character) required. Name pattern you want to search +#' for. WARNING: Does not work for common names. Search term may include +#' following options: +#' +#' * `n`: A shortcut that allows to put together several elements (e.g., `n:B. bubo Linn. 1750-1800`) +#' * `g`: a genus name. (e.g. `g:B.`, `g:Bub.`, `g:Bubo`) +#' * `isp`: an infraspecies name (e.g. `sp:bubo`, `sp:gallop.`) +#' * `asp`: either species or infraspecies (all sp) (e.g. `asp:bubo`) +#' * `ds`: data-sources IDs (e.g., `ds:1,2,3`) +#' * `tx`: parent taxon . Uses classification of the first data-source from `ds`. If data-sources are not set, uses Catalogue of Life. (e.g. `tx:Aves`) +#' * `au`: author - Search by author word (e.g. `au:Linnaeus`, `au:Linn.`) +#' * `y`: year - Search by year (e.g. `y:2005`) +#' +#' @param justtotal Return only the total results found. +#' @param ... Curl options passed on to [crul::verb-GET] +#' @author Scott Chamberlain, Zachary Foster +#' @return data.frame of results. +#' @seealso [gnr_datasources()], [gna_search()] +#' @keywords globalnamesindex names taxonomy +#' @references http://gni.globalnames.org/ +#' https://apidoc.globalnames.org/gnames +#' +#' @examples \dontrun{ +#' gna_search('n:B. bubo ds:1,2 au:Linn. y:1700-') +#' } +gna_search <- function(sci, justtotal = FALSE, parse_names = FALSE, + per_page = NULL, page = NULL, search_term = NULL, ...) { + + query <- tc(list(search_term = sci)) + cli <- crul::HttpClient$new('https://verifier.globalnames.org', + headers = tx_ual, opts = list(...)) + tt <- cli$get(path = paste0('/api/v1/search/', curl::curl_escape(sci))) + tt$raise_for_status() + out <- jsonlite::fromJSON(tt$parse("UTF-8"), FALSE) + if (justtotal) { + return(out$metadata$namesNumber) + } else { + df <- do.call(rbind, lapply(out$names, function(x) { + all_feilds <- unlist(x) + names(all_feilds) <- vapply(strsplit(names(all_feilds), split = '.', fixed = TRUE), function(x) x[length(x)], FUN.VALUE = character(1)) + all_feilds <- all_feilds[! duplicated(names(all_feilds))] + return(as.data.frame(as.list(all_feilds))) + })) + df <- colClasses(df, "character") + df <- tibble::as_tibble(df) + if (NROW(df) != 0) { + names(df) <- c("id", "name", "cardinality", "matchType", "dataSourceId", "dataSourceTitleShort", + "curation", "recordId", "outlink", "entryDate", "sortScore", + "matchedNameID", "matchedName", "matchedCardinality", "currentRecordId", + "currentNameId", "currentName", "currentCardinality", "currentCanonicalSimple", + "currentCanonicalFull", "taxonomicStatus", "isSynonym", "classificationPath", + "classificationRanks", "classificationIds", "editDistance", "stemEditDistance", + "cardinalityScore", "infraSpecificRankScore", "fuzzyLessScore", + "curatedDataScore", "authorMatchScore", "acceptedNameScore", + "parsingQualityScore", "dataSourcesNum", "dataSourcesIds") + } + + if (parse_names) { + data.frame(df, gni_parse(as.character(df$name)), stringsAsFactors = FALSE) + } else { + df + } + } +} + +#' Search for taxonomic names using the Global Names Index +#' +#' THIS FUNCTION IS DEFUNCT. +#' +#' @export +#' @keywords internal +gni_seach <- function(names, ...) { + .Defunct("ncbi_searcher", "traits", + msg = "This function is defunct. See gna_search()") +} diff --git a/R/gni_details.R b/R/gni_details.R index 41bde8fa..6bd8ec25 100644 --- a/R/gni_details.R +++ b/R/gni_details.R @@ -9,7 +9,7 @@ #' @param ... Curl options passed on to [crul::verb-GET] #' @author Scott Chamberlain #' @return Data.frame of results. -#' @seealso [gnr_datasources()], [gni_search()]. +#' @seealso [gnr_datasources()], [gna_search()]. #' @keywords globalnamesindex names taxonomy #' @examples \dontrun{ #' gni_details(id = 17802847) diff --git a/R/gni_parse.R b/R/gni_parse.R deleted file mode 100644 index ffd169ff..00000000 --- a/R/gni_parse.R +++ /dev/null @@ -1,45 +0,0 @@ -#' Parse scientific names using EOL's name parser. -#' -#' THIS FUNCTION IS DEFUNCT. -#' -#' @export -#' @keywords internal -gni_parse <- function(names, ...) { - .Defunct("ncbi_searcher", "traits", - msg = "This function is defunct. See gn_parse()") - # names <- paste0(names, collapse = "|") - # url <- paste0("https://parser.globalnames.org/api/v1/", names) - # cli <- crul::HttpClient$new(url, headers = tx_ual, opts = list(...)) - # tt <- cli$get(query = list(cultivars = cultivars, csv = TRUE)) - # tt$raise_for_status() - # out <- jsonlite::fromJSON(tt$parse("UTF-8"), FALSE) - # dt2df(lapply(out, gni_parser), idcol = FALSE) -} - -# gni_parser <- function(x) { -# positions_names <- vapply(x$scientificName$positions, function(y) -# paste("position_", y[[1]], sep = ""), "", USE.NAMES = FALSE) -# nums <- vapply(x$scientificName$positions, function(y) y[[2]], 1, -# USE.NAMES = FALSE) -# pv <- data.frame(as.list(setNames(nums, positions_names)), -# stringsAsFactors = FALSE) -# -# nmz <- c("verbatim","canonical", "normalized","hybrid","parsed") -# singles <- data.frame(x$scientificName[names(x$scientificName) %in% nmz], -# stringsAsFactors = FALSE) -# -# details2 <- data.frame() -# if (x$scientificName$parsed) { -# details_ <- x$scientificName$details[[1]] -# details_ <- details_[!names(details_) %in% 'status'] -# details <- dt2df(Map(function(x, y) data.frame(y, x, -# stringsAsFactors = FALSE), details_, names(details_)), -# idcol = FALSE)[,-3] -# details2 <- as.data.frame(t(data.frame(details[,2]))) -# names(details2) <- details[,1] -# row.names(details2) <- NULL -# } -# -# data.frame(Filter(NROW, list(details2, singles, pv)), -# stringsAsFactors = FALSE) -# } diff --git a/R/gni_verifier.R b/R/gni_verifier.R index bdde1be2..65624284 100644 --- a/R/gni_verifier.R +++ b/R/gni_verifier.R @@ -24,90 +24,3 @@ -#' @title Search for taxonomic names using the Global Names Index -#' -#' @description Uses the Global Names Index, see http://gni.globalnames.org -#' -#' @export -#' @param sci (character) required. Name pattern you want to search -#' for. WARNING: Does not work for common names. Search term may include -#' following options: -#' -#' * `n`: A shortcut that allows to put together several elements (e.g., `n:B. bubo Linn. 1750-1800`) -#' * `g`: a genus name. (e.g. `g:B.`, `g:Bub.`, `g:Bubo`) -#' * `isp`: an infraspecies name (e.g. `sp:bubo`, `sp:gallop.`) -#' * `asp`: either species or infraspecies (all sp) (e.g. `asp:bubo`) -#' * `ds`: data-sources IDs (e.g., `ds:1,2,3`) -#' * `tx`: parent taxon . Uses classification of the first data-source from `ds`. If data-sources are not set, uses Catalogue of Life. (e.g. `tx:Aves`) -#' * `au`: author - Search by author word (g.g. `au:Linnaeus`, `au:Linn.`) -#' * `y`: year - Search by year (e.g. `y:2005`) -#' -#' @param justtotal Return only the total results found. -#' @param parse_names If `TRUE`, use [gni_parse()] to parse -#' @param per_page Number of items per one page (numbers larger -#' than 1000 will be decreased to 1000) (default is 30). -#' @param page Page number you want to see (default is 1). -#' names. Default: `FALSE` -#' @param search_term Deprecated, see `sci` -#' @param ... Curl options passed on to [crul::verb-GET] -#' @author Scott Chamberlain, Zachary Foster -#' @return data.frame of results. -#' @seealso [gnr_datasources()], [gni_search()] -#' @keywords globalnamesindex names taxonomy -#' @references http://gni.globalnames.org/ -#' https://apidoc.globalnames.org/gnames -#' -#' @examples \dontrun{ -#' gni_search('n:B. bubo ds:1,2 au:Linn. y:1700-') -#' } -gni_search <- function(sci, justtotal = FALSE, parse_names = FALSE, - per_page = NULL, page = NULL, search_term = NULL, ...) { - - if (!is.null(search_term)) { - lifecycle::deprecate_warn(when = "v0.9.97", what = "gni_search(search_term)", with = "gni_search(sci)") - sci <- search_term - } - if (!is.null(per_page)) { - lifecycle::deprecate_warn(when = "v0.9.97", what = "gni_search(per_page)") - } - if (!is.null(page)) { - lifecycle::deprecate_warn(when = "v0.9.97", what = "gni_search(page)") - } - - query <- tc(list(search_term = sci)) - cli <- crul::HttpClient$new('https://verifier.globalnames.org', - headers = tx_ual, opts = list(...)) - tt <- cli$get(path = paste0('/api/v1/search/', curl::curl_escape(sci))) - tt$raise_for_status() - out <- jsonlite::fromJSON(tt$parse("UTF-8"), FALSE) - - if (justtotal) { - return(out$metadata$namesNumber) - } else { - df <- do.call(rbind, lapply(out$names, function(x) { - all_feilds <- unlist(x) - names(all_feilds) <- vapply(strsplit(names(all_feilds), split = '.', fixed = TRUE), function(x) x[length(x)], FUN.VALUE = character(1)) - all_feilds <- all_feilds[! duplicated(names(all_feilds))] - return(as.data.frame(as.list(all_feilds))) - })) - df <- colClasses(df, "character") - df <- tibble::as_tibble(df) - if (NROW(df) != 0) { - names(df) <- c("id", "name", "cardinality", "matchType", "dataSourceId", "dataSourceTitleShort", - "curation", "recordId", "outlink", "entryDate", "sortScore", - "matchedNameID", "matchedName", "matchedCardinality", "currentRecordId", - "currentNameId", "currentName", "currentCardinality", "currentCanonicalSimple", - "currentCanonicalFull", "taxonomicStatus", "isSynonym", "classificationPath", - "classificationRanks", "classificationIds", "editDistance", "stemEditDistance", - "cardinalityScore", "infraSpecificRankScore", "fuzzyLessScore", - "curatedDataScore", "authorMatchScore", "acceptedNameScore", - "parsingQualityScore", "dataSourcesNum", "dataSourcesIds") - } - - if (parse_names) { - data.frame(df, gni_parse(as.character(df$name)), stringsAsFactors = FALSE) - } else { - df - } - } -} diff --git a/R/gnr_datasources.R b/R/gnr_datasources.R index 3986a6bd..7c8c62b5 100644 --- a/R/gnr_datasources.R +++ b/R/gnr_datasources.R @@ -6,7 +6,7 @@ #' @param ... Curl options passed on to [crul::HttpClient] #' @param todf defunct, always get a data.frame back now #' @return data.frame/tibble -#' @seealso [gnr_resolve()], [gni_search()] +#' @seealso [gnr_resolve()], [gna_search()] #' @keywords resolve names taxonomy #' @references https://resolver.globalnames.org/data_sources #' @examples \dontrun{ diff --git a/R/iucn_getname.R b/R/iucn_getname.R index ede5273e..0a79517d 100644 --- a/R/iucn_getname.R +++ b/R/iucn_getname.R @@ -24,7 +24,7 @@ #' } iucn_getname <- function(name, verbose = TRUE, ...) { mssg(verbose, "searching Global Names ...") - all_names <- gni_search(sci = name, parse_names = TRUE) + all_names <- gna_search(sci = name, parse_names = TRUE) if (NROW(all_names) == 0) { stop("No names found matching ", name, call. = FALSE) } diff --git a/R/taxize-package.R b/R/taxize-package.R index 9134f777..cb702aef 100644 --- a/R/taxize-package.R +++ b/R/taxize-package.R @@ -74,7 +74,6 @@ #' @importFrom cli symbol cat_line rule #' @name taxize-package #' @aliases taxize -#' @docType package #' @author Scott Chamberlain #' @author Eduard Szoecs \email{eduardszoecs@@gmail.com} #' @author Zachary Foster \email{zacharyfoster1989@@gmail.com} diff --git a/R/taxize_cite.R b/R/taxize_cite.R index a5404922..357619a1 100644 --- a/R/taxize_cite.R +++ b/R/taxize_cite.R @@ -132,7 +132,7 @@ data_citations <- function(x){ gisd_isinvasive = list(gisd = c_gisd), gni_details = list(gni = c_gni), gni_parse = list(gni = c_gni), - gni_search = list(gni = c_gni), + gna_search = list(gni = c_gni), gnr_datasources = list(global_names = c_gnames), gnr_resolve = list(global_names = c_gnames), iplant_resolve = list(iplant = c_iplant), diff --git a/man/gbif_parse.Rd b/man/gbif_parse.Rd index 811e2139..facb4f55 100644 --- a/man/gbif_parse.Rd +++ b/man/gbif_parse.Rd @@ -31,7 +31,7 @@ gbif_parse(c('Arrhenatherum elatius var. elatius', https://www.gbif.org/tools/name-parser/about } \seealso{ -\code{\link[=gni_parse]{gni_parse()}}, \code{\link[=gn_parse]{gn_parse()}} +\code{\link[=gni_parse]{gni_parse()}}, \code{\link[=gna_parse]{gna_parse()}} } \author{ John Baumgartner \email{johnbb@student.unimelb.edu.au} diff --git a/man/gn_parse.Rd b/man/gna_parse.Rd similarity index 68% rename from man/gn_parse.Rd rename to man/gna_parse.Rd index 6f6f28a8..88d41cfa 100644 --- a/man/gn_parse.Rd +++ b/man/gna_parse.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gn_parse.R -\name{gn_parse} -\alias{gn_parse} +% Please edit documentation in R/gna_parse.R +\name{gna_parse} +\alias{gna_parse} \title{Parse scientific names using Global Names Parser} \usage{ -gn_parse(names, ...) +gna_parse(names, ...) } \arguments{ \item{names}{A vector of length 1 or more taxonomic names} @@ -20,17 +20,17 @@ Parse scientific names using Global Names Parser } \examples{ \dontrun{ -gn_parse("Cyanistes caeruleus") -gn_parse("Plantago minor") -gn_parse("Plantago minor minor") -gn_parse(c("Plantago minor minor","Helianthus annuus texanus")) +gna_parse("Cyanistes caeruleus") +gna_parse("Plantago minor") +gna_parse("Plantago minor minor") +gna_parse(c("Plantago minor minor","Helianthus annuus texanus")) # if > 20 names, uses an HTTP POST request x <- names_list("species", size = 30) -gn_parse(x) +gna_parse(x) # pass on curl options -gn_parse("Cyanistes caeruleus", verbose = TRUE) +gna_parse("Cyanistes caeruleus", verbose = TRUE) } } \references{ diff --git a/man/gna_search.Rd b/man/gna_search.Rd new file mode 100644 index 00000000..0de61da4 --- /dev/null +++ b/man/gna_search.Rd @@ -0,0 +1,59 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gna_search.R +\name{gna_search} +\alias{gna_search} +\title{Search for taxonomic names using the Global Names Architecture} +\usage{ +gna_search( + sci, + justtotal = FALSE, + parse_names = FALSE, + per_page = NULL, + page = NULL, + search_term = NULL, + ... +) +} +\arguments{ +\item{sci}{(character) required. Name pattern you want to search +for. WARNING: Does not work for common names. Search term may include +following options: +\itemize{ +\item \code{n}: A shortcut that allows to put together several elements (e.g., \verb{n:B. bubo Linn. 1750-1800}) +\item \code{g}: a genus name. (e.g. \code{g:B.}, \code{g:Bub.}, \code{g:Bubo}) +\item \code{isp}: an infraspecies name (e.g. \code{sp:bubo}, \code{sp:gallop.}) +\item \code{asp}: either species or infraspecies (all sp) (e.g. \code{asp:bubo}) +\item \code{ds}: data-sources IDs (e.g., \verb{ds:1,2,3}) +\item \code{tx}: parent taxon . Uses classification of the first data-source from \code{ds}. If data-sources are not set, uses Catalogue of Life. (e.g. \code{tx:Aves}) +\item \code{au}: author - Search by author word (e.g. \code{au:Linnaeus}, \code{au:Linn.}) +\item \code{y}: year - Search by year (e.g. \code{y:2005}) +}} + +\item{justtotal}{Return only the total results found.} + +\item{...}{Curl options passed on to \link[crul:verb-GET]{crul::verb-GET}} +} +\value{ +data.frame of results. +} +\description{ +Uses the Global Names Index, see http://gni.globalnames.org +} +\examples{ +\dontrun{ +gna_search('n:B. bubo ds:1,2 au:Linn. y:1700-') +} +} +\references{ +http://gni.globalnames.org/ +https://apidoc.globalnames.org/gnames +} +\seealso{ +\code{\link[=gnr_datasources]{gnr_datasources()}}, \code{\link[=gna_search]{gna_search()}} +} +\author{ +Scott Chamberlain, Zachary Foster +} +\keyword{globalnamesindex} +\keyword{names} +\keyword{taxonomy} diff --git a/man/gni_details.Rd b/man/gni_details.Rd index edd99dd0..abc238d3 100644 --- a/man/gni_details.Rd +++ b/man/gni_details.Rd @@ -29,7 +29,7 @@ gni_details(id = 17802847, verbose = TRUE) } } \seealso{ -\code{\link[=gnr_datasources]{gnr_datasources()}}, \code{\link[=gni_search]{gni_search()}}. +\code{\link[=gnr_datasources]{gnr_datasources()}}, \code{\link[=gna_search]{gna_search()}}. } \author{ Scott Chamberlain diff --git a/man/gni_parse.Rd b/man/gni_parse.Rd index 8d8c5632..2d0277d5 100644 --- a/man/gni_parse.Rd +++ b/man/gni_parse.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gni_parse.R +% Please edit documentation in R/gna_parse.R \name{gni_parse} \alias{gni_parse} \title{Parse scientific names using EOL's name parser.} diff --git a/man/gni_seach.Rd b/man/gni_seach.Rd new file mode 100644 index 00000000..3817aa4d --- /dev/null +++ b/man/gni_seach.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gna_search.R +\name{gni_seach} +\alias{gni_seach} +\title{Search for taxonomic names using the Global Names Index} +\usage{ +gni_seach(names, ...) +} +\description{ +THIS FUNCTION IS DEFUNCT. +} +\keyword{internal} diff --git a/man/gni_search.Rd b/man/gni_search.Rd deleted file mode 100644 index d8413d88..00000000 --- a/man/gni_search.Rd +++ /dev/null @@ -1,87 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gni_search.R -\name{gni_search} -\alias{gni_search} -\title{Search for taxonomic names using the Global Names Index} -\usage{ -gni_search( - sci, - per_page = NULL, - page = NULL, - justtotal = FALSE, - parse_names = FALSE, - search_term = NULL, - ... -) -} -\arguments{ -\item{sci}{(character) required. Name pattern you want to search -for. WARNING: Does not work for common names. Search term may include -following options (Note: can, uni, gen, sp, ssp, au, yr work only for -parsed names) -\itemize{ -\item \code{*} wild card - Search by part of a word (E.g.: planta*) -\item \code{exact} exact match - Search for exact match of a literal string -(E.g.: exact:Parus major) -\item \code{ns} name string- Search for literal string from its beginning (other -modifiers will be ignored) (E.g.: ns:parus maj*) -\item \code{can} canonical form- Search name without authors (other modifiers will -be ignored) (E.g.: can:parus major) -\item \code{uni} uninomial- Search for higher taxa (E.g.: uni:parus) -\item \code{gen} genus - Search by genus epithet of species name (E.g.: gen:parus) -\item \code{sp} species - Search by species epithet (E.g.: sp:major) -\item \code{ssp} subspecies - Search by infraspecies epithet (E.g.: ssp:major) -\item \code{au} author - Search by author word (E.g.: au:Shipunov) -\item \code{yr} year - Search by year (E.g.: yr:2005) -}} - -\item{per_page}{Number of items per one page (numbers larger -than 1000 will be decreased to 1000) (default is 30).} - -\item{page}{Page number you want to see (default is 1).} - -\item{justtotal}{Return only the total results found.} - -\item{parse_names}{If \code{TRUE}, use \code{\link[=gni_parse]{gni_parse()}} to parse -names. Default: \code{FALSE}} - -\item{search_term}{Deprecated, see \code{sci}} - -\item{...}{Curl options passed on to \link[crul:verb-GET]{crul::verb-GET}} -} -\value{ -data.frame of results. -} -\description{ -Uses the Global Names Index, see http://gni.globalnames.org -} -\details{ -Note that you can use fuzzy searching, e.g., by attaching an -asterisk to the end of a search term. See the first two examples below -} -\examples{ -\dontrun{ -gni_search(sci = "ani*") -gni_search(sci = "ama*", per_page = 3, page = 21) -gni_search(sci = "animalia", per_page = 8, page = 1) -gni_search(sci = "animalia", per_page = 8, page = 1, justtotal=TRUE) - -gni_search(sci = "Cyanistes caeruleus", parse_names=TRUE) - -# pass on curl options -gni_search(sci = "ani*", verbose = TRUE) -} -} -\references{ -http://gni.globalnames.org/ -https://github.com/dimus/gni/wiki/api -} -\seealso{ -\code{\link[=gnr_datasources]{gnr_datasources()}}, \code{\link[=gni_search]{gni_search()}} -} -\author{ -Scott Chamberlain -} -\keyword{globalnamesindex} -\keyword{names} -\keyword{taxonomy} diff --git a/man/gnr_datasources.Rd b/man/gnr_datasources.Rd index 3704d040..364e8de4 100644 --- a/man/gnr_datasources.Rd +++ b/man/gnr_datasources.Rd @@ -35,7 +35,7 @@ out[agrep("zoo", out$title, ignore.case = TRUE), ] https://resolver.globalnames.org/data_sources } \seealso{ -\code{\link[=gnr_resolve]{gnr_resolve()}}, \code{\link[=gni_search]{gni_search()}} +\code{\link[=gnr_resolve]{gnr_resolve()}}, \code{\link[=gna_search]{gna_search()}} } \keyword{names} \keyword{resolve} diff --git a/man/taxize-package.Rd b/man/taxize-package.Rd index 5eedc5cf..1341fe36 100644 --- a/man/taxize-package.Rd +++ b/man/taxize-package.Rd @@ -1,6 +1,5 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxize-package.R -\docType{package} \name{taxize-package} \alias{taxize-package} \alias{taxize} @@ -69,16 +68,6 @@ when it's stable. See https://github.com/ropensci/colpluz for the R implementation for CoL+ } -\seealso{ -Useful links: -\itemize{ - \item \url{https://docs.ropensci.org/taxize/ (website)} - \item \url{https://github.com/ropensci/taxize (devel)} - \item \url{https://taxize.dev (user manual)} - \item Report bugs at \url{https://github.com/ropensci/taxize/issues} -} - -} \author{ Scott Chamberlain