R/to_newick.R

Defines functions patristic_matrix_to_newick

Documented in patristic_matrix_to_newick

#' Convert patristic matrix to a newick string. Used inside: summarize_datelife_result.
#' @param patristic_matrix A patristic matrix
#' @return A newick string
#' @export
patristic_matrix_to_newick <- function(patristic_matrix) {
  tree <- patristic_matrix_to_phylo(patristic_matrix)
  if (inherits(tree, "phylo")) {
    return(ape::write.tree(tree))
  }
  return(NA)
}

Try the datelife package in your browser

Any scripts or data that you put into this service are public.

datelife documentation built on July 10, 2023, 2:02 a.m.