Skip to content

Commit

Permalink
Minor fixes post merge
Browse files Browse the repository at this point in the history
  • Loading branch information
DomBennett committed Nov 1, 2020
1 parent a851686 commit eee4a55
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Imports:
bigmemory
Suggests:
testthat
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
Collate:
'calc-methods.R'
'check_methods.R'
Expand Down
11 changes: 6 additions & 5 deletions R/cnvrt-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ setOldClass('multiPhylo')

#' @name TreeMan-to-phylo
#' @title Convert TreeMan to phylo
#' @description Return ape's \code{phylo} from a \code{TreeMan}. This will preserve node labels if they are different from the default labels (n#).
#' @description Return ape's \code{phylo} from a \code{TreeMan}. This will
#' preserve node labels if they are different from the default labels (n#).
#' @seealso
#' \code{\link{phylo-to-TreeMan}},
#' \code{\link{TreeMen-to-multiPhylo}}
Expand All @@ -37,8 +38,8 @@ setAs(from="phylo", to="TreeMan", def=function(from, to) {

#' @name phylo-to-TreeMan
#' @title Convert phylo to TreeMan
#' @description Return a \code{TreeMan} from ape's \code{phylo}. This will preserve node labels, if they are a alphanumeric.

#' @description Return a \code{TreeMan} from ape's \code{phylo}. This will
#' preserve node labels, if they are a alphanumeric.
#' @seealso
#' \code{\link{TreeMan-to-phylo}},
#' \code{\link{TreeMen-to-multiPhylo}}
Expand All @@ -55,9 +56,9 @@ setAs(from="TreeMan", to="phylo", def=function(from, to) {
# use a node label function function that writes the node labels during the
# conversion, if they are non default.
if (all(from["nds"] == paste0("n", seq_along(from["nds"])))) {
node_labeller <- function(nd) { return(NULL) } # no node labels
nodeLabeller <- function(nd) { return(NULL) } # no node labels
} else {
nodeLabeller <- function(n) { n[['id']] } # writes node labels
nodeLabeller <- function(nd) { nd[['id']] } # writes node labels
}

writeTree(from, file=temp_file, ndLabels = nodeLabeller)
Expand Down
3 changes: 2 additions & 1 deletion man/TreeMan-to-phylo.Rd

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

3 changes: 2 additions & 1 deletion man/phylo-to-TreeMan.Rd

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

0 comments on commit eee4a55

Please sign in to comment.