Skip to content

Commit

Permalink
Update docs and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchang committed Apr 2, 2019
1 parent d3ecab8 commit a08ea41
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,25 @@ fishtree_tip_rates <- function(species, rank, sampled_only = TRUE) {
#' Retrieves a complete, stochastically-resolved phylogeny via the Fish Tree of Life API. If neither `species` nor `rank` are specified, returns the entire phylogeny.
#'
#' @inheritParams fishtree_phylogeny
#' @param mc.cores Number of cores to use in \link[parallel]{mclapply} when subsetting the tree (default `1``)
#' @param mc.cores Number of cores to use in \link[parallel]{mclapply} when subsetting the tree (default `1`)
#' @return An object of class `"multiPhylo"`.
#' @export
#' @references
#' Rabosky, D. L., Chang, J., Title, P. O., Cowman, P. F., Sallan, L., Friedman, M., Kashner, K., Garilao, C., Near, T. J., Coll, M., Alfaro, M. E. (2018). An inverse latitudinal gradient in speciation rate for marine fishes. Nature, 559(7714), 392–395. doi:10.1038/s41586-018-0273-1
#'
#' Enhanced polytomy resolution strengthens evidence for global gradient in speciation rate for marine fishes. \url{https://fishtreeoflife.org/rabosky-et-al-2018-update/}
#' @examples
#' \dontrun{
#' tree <- fishtree_complete_phylogeny(rank = "Acanthuridae")
#' sampled_tips <- fishtree_phylogeny(rank = "Acanthuridae")$tip.label
#' all_tips <- tree[[1]]$tip.label
#' new_tips <- setdiff(all_tips, sampled_tips)
#' par(mfrow = c(2,2))
#' for (ii in 1:4) {
#' plot(tree[[ii]], show.tip.label = FALSE, no.margin = TRUE)
#' ape::tiplabels(pch = 19, col = ifelse(tree[[ii]]$tip.label %in% new_tips, "red", NA))
#' }
#' }
#' @import parallel
fishtree_complete_phylogeny <- function(species, rank, mc.cores = getOption("mc.cores", 1L)) {
if (!rlang::is_missing(species) && !rlang::is_missing(rank)) rlang::abort("Must supply at most one of either `species` or `rank`, not both")
Expand Down
12 changes: 11 additions & 1 deletion man/fishtree_complete_phylogeny.Rd

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

0 comments on commit a08ea41

Please sign in to comment.