Skip to content

Commit

Permalink
fix #522 fixed iucn_summary, now has key param, bumped dev version
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Apr 6, 2016
1 parent 6b0165c commit 406e59f
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 34 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: taxize
Title: Taxonomic Information from Around the Web
Description: Interacts with a suite of web 'APIs' for taxonomic tasks,
such as verifying species names, and getting taxonomic 'hierarchies'.
Version: 0.7.4.99991
Version: 0.7.4.99993
License: MIT + file LICENSE
URL: https://github.com/ropensci/taxize
BugReports: https://github.com/ropensci/taxize/issues
Expand All @@ -26,7 +26,7 @@ Imports:
methods,
stats,
utils,
httr (>= 1.0.0),
httr (>= 1.1.0),
xml2 (>= 0.1.2),
jsonlite,
reshape2,
Expand Down
43 changes: 28 additions & 15 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,71 @@
taxize 0.7.5
============

## MINOR IMPROVEMENTS

* xxx (#xxx)
* xxx (#xxx)

## BUG FIXES

* xxx (#xxx)


taxize 0.7.4
===============

## NEW FEATURES

* New function `lowest_common()` for obtaining the lowest common taxon and
* New function `lowest_common()` for obtaining the lowest common taxon and
rank for a given taxon name or ID. Methods so far for ITIS, NCBI, and GBIF (#505)
* New contributor James O'Donnell (@jimmyodonnell) (via #505)
* Now importing `rredlist` [rredlist](https://github.com/ropenscilabs/rredlist)
* New function `iucn_summary_id()` - same as `iucn_summary()`, except takes
IUCN IDs as input instead of taxonomic names (#493)
* All taxonomic rank columns in data.frame's now given back as lower case.
* All taxonomic rank columns in data.frame's now given back as lower case.
This provides consistency, which is important, and many functions use ranks
to determine what to do next, so using a consistent case is good.

## MINOR IMPROVEMENTS

* `iucn_summary()` fixes, long story short: a number of bug fixes, and uses
the new IUCN API via the newish package `rredlist` when IDs are given as input,
the new IUCN API via the newish package `rredlist` when IDs are given as input,
but uses the old IUCN API when taxonomic names given. Also: gains new parameter `distr_details`
(#174) (#472) (#487) (#488)
* Replaced `XML` with `xml2` for XML parsing (#499)
* Fixes to internal use of `httr::content` to explicitly state `encoding="UTF-8"` (#498)
* `gnr_resolve()` now outputs a column (`user_supplied_name`) for the exact input taxon
* `gnr_resolve()` now outputs a column (`user_supplied_name`) for the exact input taxon
name - facilitates merging data back to original data inputs (#486) thanks @Alectoria
* `eol_dataobjects()` gains new parameter `taxonomy` to toggle whether to return
* `eol_dataobjects()` gains new parameter `taxonomy` to toggle whether to return
any taxonomy details from different data providers (#497)
* Catalogue of Life URLs changed - updated all appropriate COL functions to use
* Catalogue of Life URLs changed - updated all appropriate COL functions to use
the new URLs (#501)
* `classification()` was giving back rank values in mixed case from different data
* `classification()` was giving back rank values in mixed case from different data
providers (e.g., `class` vs. `Class`). All rank values are now all lowercase (#504)
* Changed number of results returned from internal GBIF search in `get_gbfid` to
* Changed number of results returned from internal GBIF search in `get_gbfid` to
50 from 20. Gives back more results, so more likely to get the thing searched for (#513)
* Fix to `gni_search()` to make all output columns `character` class
* `iucn_id()`, `tpl_families()`, and `tpl_get()` all gain a new parameter `...` to
* `iucn_id()`, `tpl_families()`, and `tpl_get()` all gain a new parameter `...` to
pass on curl options to `httr::GET()`

## BUG FIXES

* Fixes to `get_eolid()`: URI returned now always has the pageid, and goes to the
* Fixes to `get_eolid()`: URI returned now always has the pageid, and goes to the
right place; API key if passed in now actually used, woopsy (#484)
* Fixes to `get_uid()`: when a taxon not found, the "match" attribute was saying
found sometimes anyway - that is now fixed; additionally, fixed docs to correctly
state that we give back `'NA due to ask=FALSE'` when `ask = FALSE` (#489) Additionally,
state that we give back `'NA due to ask=FALSE'` when `ask = FALSE` (#489) Additionally,
made this doc fix in other `get_*()` function docs
* Fix to `apgOrders()` function (#490)
* Fixes to `tp_search()` which fixes `get_tpsid()`: Tropicos doesn't allow periods (`.`) in
* Fixes to `tp_search()` which fixes `get_tpsid()`: Tropicos doesn't allow periods (`.`) in
query strings, so those are URL encoded now; Tropicos doesn't like sub-specific rank names
in name query strings, so we warn when those are found, but don't alter user inputs; and
in name query strings, so we warn when those are found, but don't alter user inputs; and
improved docs to be more clear about how the function fails (#491) thanks @scelmendorf !
* Fix to `classification(db = "itis")` to fail better when no taxa found (#495) thanks @ashenkin !
* `eol_pages()` fixes: the EOL API route for this method gained a new parameter `taxonomy`,
* `eol_pages()` fixes: the EOL API route for this method gained a new parameter `taxonomy`,
this function gains that parameter. That change caused this fxn to fail. Now fixed. Also,
parameter `subject` changed to `subjects` (#500)
* Fix to `col_search()` due to when `misapplied name` come back as a data slot. There
* Fix to `col_search()` due to when `misapplied name` come back as a data slot. There
was previously no parser for that type. Now there is, and it works (#512)

taxize 0.7.0
Expand Down
29 changes: 21 additions & 8 deletions R/iucn_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#' returned as a list of vectors corresponding to the different range types:
#' native, introduced, etc.
#' @param key a Redlist API key, get one from \url{http://apiv3.iucnredlist.org/api/v3/token}
#' Required for \code{iucn_summary} but not needed for \code{iucn_summary_id}
#' Required for \code{iucn_summary} but not needed for \code{iucn_summary_id}. Defaults to
#' \code{NULL} in case you have your key stored (see \code{Redlist Authentication} below).
#' @param ... Currently not used.
#'
#' @return A list (for every species one entry) of lists with the following
Expand All @@ -34,12 +35,26 @@
#' We will fix these as soon as possible. In the meantime, just make sure that
#' the data you get back is correct.
#'
#' @section Redlist Authentication:
#' \code{iucn_summary} uses the new Redlist API for searching for a IUCN ID, so we
#' use the \code{\link[rredlist]{rl_search}} function internally. This function
#' requires an API key. Get the key at \url{http://apiv3.iucnredlist.org/api/v3/token},
#' and pass it to the \code{key} parameter, or store in your \code{.Renviron} file like
#' \code{IUCN_REDLIST_KEY=yourkey} or in your \code{.Rprofile} file like
#' \code{options(iucn_redlist_key="yourkey"}. We strongly encourage you to not pass
#' the key in the function call but rather store it in one of those two files.
#' This key will also set you up to use the \pkg{rredlist} package.
#'
#' @examples \dontrun{
#' # if you send a taxon name, pass in a key
#' # iucn_summary("Lutra lutra", key = "your key")
#' iucn_summary("Lutra lutra")
#'
#' # ia <- iucn_summary(c("Panthera uncia", "Lynx lynx"))
#' # ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa"))
#' ia <- iucn_summary(c("Panthera uncia", "Lynx lynx"))
#' ia <- iucn_summary(c("Panthera uncia", "Lynx lynx", "aaa"))
#'
#' ## get detailed distribution
#' iac <- iucn_summary("Ara chloropterus", distr_detail = TRUE)
#' iac[[1]]$distr
#'
#' # If you pass in an IUCN ID, you don't need to pass in a Redlist API Key
#' ia <- iucn_summary_id(c(22732, 12519))
Expand All @@ -49,15 +64,13 @@
#' ia[['Lynx lynx']]$history
#' ia[['Panthera uncia']]$distr
#' ia[[2]]$trend
#' # get detailed distribution
#' iac <- iucn_summary("Ara chloropterus", distr_detail = TRUE)
#' iac[[1]]$distr
#' }
#' @export
#' @author Eduard Szoecs, \email{eduardszoecs@@gmail.com}
#' @author Philippe Marchand, \email{marchand.philippe@@gmail.com}
#' @author Scott Chamberlain, \email{myrmecocystus@@gmail.com}
iucn_summary <- function(sciname, silent = TRUE, parallel = FALSE,
distr_detail = FALSE, key, ...) {
distr_detail = FALSE, key = NULL, ...) {
get_iucn_summary(sciname, silent, parallel, distr_detail, by_id = FALSE, key = key, ...)
}

Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
R CMD CHECK passed on my local OS X install with R 3.2.3 and
R CMD CHECK passed on my local OS X install with R 3.2.4 and
R development version, Ubuntu running on Travis-CI, and Win builder.

This submission includes many bug fixes and improvements, and a new function, detailed
Expand Down
31 changes: 23 additions & 8 deletions man/iucn_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 406e59f

Please sign in to comment.