R/match.nodelabels.R

match.nodelabels <- function(source, target){
	
	 	nl <- character(source$Nnode)
        pp <- prop.part(source, check.labels = FALSE)
        labs <- attr(pp, "labels")
        fl <- tempfile()
        for (i in seq_len(source$Nnode)) {
            cat(sort(labs[pp[[i]]]), sep = "\n", file = fl)
            nl[i] <- tools::md5sum(fl)
        }
        unlink(fl)
        source$node.label <- nl
    #x1 <- makeNodeLabel(source, "md5sum")
    x2 <- makeNodeLabel(target, "md5sum")
    match(x2$node.label, source$node.label)
}
fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.