From 86d42647e026cdaf6474d350744add18290eaa26 Mon Sep 17 00:00:00 2001 From: emmanuelparadis Date: Sun, 28 Jan 2024 09:43:15 +0700 Subject: [PATCH] ace() now uses node labels if available --- DESCRIPTION | 2 +- NEWS | 2 ++ R/ace.R | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2c22db5..fece96e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ape Version: 5.7-1.8 -Date: 2024-01-15 +Date: 2024-01-28 Title: Analyses of Phylogenetics and Evolution Authors@R: c(person("Emmanuel", "Paradis", role = c("aut", "cre", "cph"), email = "Emmanuel.Paradis@ird.fr", comment = c(ORCID = "0000-0003-3092-2199")), person("Simon", "Blomberg", role = c("aut", "cph"), comment = c(ORCID = "0000-0003-1062-0839")), diff --git a/NEWS b/NEWS index eca7543..2788505 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,8 @@ OTHER CHANGES size. The code is three times faster with small trees; twice faster with ~1000 tips (the gain is less with bigger trees). + o ace() now uses node labels, if available, in the output. + CHANGES IN APE VERSION 5.7-1 diff --git a/R/ace.R b/R/ace.R index fe5aec2..1deadff 100644 --- a/R/ace.R +++ b/R/ace.R @@ -1,8 +1,8 @@ -## ace.R (2022-03-02) +## ace.R (2024-01-28) ## Ancestral Character Estimation -## Copyright 2005-2022 Emmanuel Paradis and 2005 Ben Bolker +## Copyright 2005-2024 Emmanuel Paradis and 2005 Ben Bolker ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -298,6 +298,12 @@ ace <- obj$lik.anc <- lik.anc } } + ## edited from Thomas G (PR #106): + if (!is.null(phy$node.label)) { + names(obj$ace) <- phy$node.label + if (!is.null(obj$CI95)) + rownames(obj$CI95) <- phy$node.label + } obj$call <- match.call() class(obj) <- "ace" obj