-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add final functions; fix up documentation
- Loading branch information
1 parent
def557b
commit 0a97896
Showing
24 changed files
with
223 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#' Population trend assessment summary | ||
#' | ||
#' Return a list of the latest assessments based on a population trend (i.e. | ||
#' increasing, decreasing, stable or unknown). | ||
#' | ||
#' @export | ||
#' @param code (character) The code of the growth form to look up. If not | ||
#' supplied, a list of all growth forms will be returned. | ||
#' @template all | ||
#' @template info | ||
#' @template page | ||
#' @examples \dontrun{ | ||
#' # Get list of all population trends | ||
#' rl_pop_trends() | ||
#' # Get assessment summary for stable population trends | ||
#' rl_pop_trends("2") | ||
#' } | ||
rl_pop_trends <- function(code = NULL, key = NULL, parse = TRUE, all = TRUE, | ||
page = 1, quiet = FALSE,...) { | ||
assert_is(parse, 'logical') | ||
assert_is(all, 'logical') | ||
|
||
res <- rl_pop_trends_(code, key, all, page, quiet, ...) | ||
if (all) { | ||
combine_assessments(res, parse) | ||
} else { | ||
rl_parse(res, parse) | ||
} | ||
} | ||
|
||
#' @export | ||
#' @rdname rl_pop_trends | ||
rl_pop_trends_ <- function(code = NULL, key = NULL, all = TRUE, page = 1, | ||
quiet = FALSE, ...) { | ||
assert_is(key, 'character') | ||
assert_is(code, 'character') | ||
assert_is(page, c('integer', 'numeric')) | ||
assert_n(page, 1) | ||
assert_is(all, 'logical') | ||
assert_is(quiet, 'logical') | ||
|
||
path <- paste("population_trends", code, sep = "/") | ||
|
||
if (all) { | ||
page_assessments(path, key, quiet, ...) | ||
} else { | ||
rr_GET(path, key, query = list(page = page), ...) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#' @return A list, with the data in the \code{result} slot, unless using | ||
#' a function with a trailing underscore, in which case json as character | ||
#' string is returned. | ||
#' @references API docs at https://apiv3.iucnredlist.org/api/v3/docs. | ||
#' @return A list unless using a function with a trailing underscore, in which | ||
#' case json as character string is returned. | ||
#' @references API docs at <https://api.iucnredlist.org/>. |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.