-
Notifications
You must be signed in to change notification settings - Fork 14
/
rl_search.R
30 lines (29 loc) · 906 Bytes
/
rl_search.R
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
#' Search by taxon name, IUCN id, and region
#'
#' @export
#' @template commonargs
#' @template all
#' @template info
#' @examples \dontrun{
#' rl_search('Fratercula arctica')
#' rl_search('Fratercula arctica', region = 'europe')
#' rl_search(id = 12392)
#' rl_search(id = 22694927, region = 'europe')
#'
#' rl_search('Fratercula arctica', parse = FALSE)
#' rl_search_('Fratercula arctica')
#' rl_search_('Fratercula arctica', region = 'europe')
#' }
rl_search <- function(name = NULL, id = NULL, region = NULL,
key = NULL, parse = TRUE, ...) {
assert_is(parse, 'logical')
rl_parse(rl_search_(name, id, region, key, ...), parse)
}
#' @export
#' @rdname rl_search
rl_search_ <- function(name = NULL, id = NULL, region = NULL,
key = NULL, ...) {
assert_is(key, 'character')
rr_GET(nir("species", "species/id",
name, id, region), key, ...)
}