[Adephylo-commits] r202 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Nov 8 17:23:08 CET 2014
Author: aebilgrau
Date: 2014-11-08 17:23:08 +0100 (Sat, 08 Nov 2014)
New Revision: 202
Modified:
pkg/R/utils.R
Log:
sp.tips should now return the internal nodes in the correct order for a walk along the tree
Modified: pkg/R/utils.R
===================================================================
--- pkg/R/utils.R 2013-11-29 15:46:01 UTC (rev 201)
+++ pkg/R/utils.R 2014-11-08 16:23:08 UTC (rev 202)
@@ -90,7 +90,7 @@
## function pathTwoTips (takes two path-to-root as args)
pathTwoTips <- function(path1, path2){
- cpath <- c(path1, path2)
+ cpath <- c(path1, rev(path2))
temp <- factor(cpath, levels=unique(cpath))
CA <- temp[table(temp)==2][1] # most recent common ancestor (MRCA)
CA <- as.integer(as.character(CA)) # retrieve integer type
@@ -103,7 +103,7 @@
pathTwoTips.no.mrca <- function(path1, path2){
- cpath <- c(path1, path2)
+ cpath <- c(path1, rev(path2))
temp <- intersect(path1, path2)
res <- setdiff(cpath, temp)
return(res)
More information about the Adephylo-commits
mailing list