Skip to content

Commit

Permalink
fix #529 - use requirenamespace for tax_agg eg
Browse files Browse the repository at this point in the history
bumped dev version for this change
  • Loading branch information
sckott committed May 12, 2016
1 parent 9551c9e commit d0febf0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 45 deletions.
2 changes: 1 addition & 1 deletion 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.6
Version: 0.7.6.9100
License: MIT + file LICENSE
URL: https://github.com/ropensci/taxize
BugReports: https://github.com/ropensci/taxize/issues
Expand Down
46 changes: 24 additions & 22 deletions R/tax_agg.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,32 @@
#'
#' @seealso \code{\link[taxize]{tax_name}}
#' @examples \dontrun{
#' # use dune dataset
#' library("vegan")
#' data(dune, package='vegan')
#' species <- c("Bellis perennis", "Empetrum nigrum", "Juncus bufonius",
#' "Juncus articulatus",
#' "Aira praecox", "Eleocharis parvula", "Rumex acetosa", "Vicia lathyroides",
#' "Brachythecium rutabulum", "Ranunculus flammula", "Cirsium arvense",
#' "Hypochaeris radicata", "Leontodon autumnalis", "Potentilla palustris",
#' "Poa pratensis", "Calliergonella cuspidata", "Trifolium pratense",
#' "Trifolium repens", "Anthoxanthum odoratum", "Salix repens", "Achillea
#' millefolium",
#' "Poa trivialis", "Chenopodium album", "Elymus repens", "Sagina procumbens",
#' "Plantago lanceolata", "Agrostis stolonifera", "Lolium perenne", "Alopecurus
#' geniculatus",
#' "Bromus hordeaceus")
#' colnames(dune) <- species
#' if (requireNamespace("vegan", quietly = TRUE)) {
#' # use dune dataset
#' library("vegan")
#' data(dune, package='vegan')
#' species <- c("Bellis perennis", "Empetrum nigrum", "Juncus bufonius",
#' "Juncus articulatus",
#' "Aira praecox", "Eleocharis parvula", "Rumex acetosa", "Vicia lathyroides",
#' "Brachythecium rutabulum", "Ranunculus flammula", "Cirsium arvense",
#' "Hypochaeris radicata", "Leontodon autumnalis", "Potentilla palustris",
#' "Poa pratensis", "Calliergonella cuspidata", "Trifolium pratense",
#' "Trifolium repens", "Anthoxanthum odoratum", "Salix repens", "Achillea
#' millefolium",
#' "Poa trivialis", "Chenopodium album", "Elymus repens", "Sagina procumbens",
#' "Plantago lanceolata", "Agrostis stolonifera", "Lolium perenne", "Alopecurus
#' geniculatus",
#' "Bromus hordeaceus")
#' colnames(dune) <- species
#'
#' # aggregate sample to families
#' (agg <- tax_agg(dune, rank = 'family', db = 'ncbi'))
#' # aggregate sample to families
#' (agg <- tax_agg(dune, rank = 'family', db = 'ncbi'))
#'
#' # extract aggregated community data matrix for further usage
#' agg$x
#' # check which taxa have been aggregated
#' agg$by
#' # extract aggregated community data matrix for further usage
#' agg$x
#' # check which taxa have been aggregated
#' agg$by
#' }
#'
#' # A use case where there are different taxonomic levels in the same dataset
#' spnames <- c('Puma','Ursus americanus','Ursidae')
Expand Down
46 changes: 24 additions & 22 deletions man/tax_agg.Rd

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

0 comments on commit d0febf0

Please sign in to comment.