X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fklastorin.R;h=3d19128e3d5b97bb30b683ed3d26a71a5ff47ab0;hb=7e78dcfcf1bca3d6aaca7ae92ab0f4fb3d9cc711;hp=27ba6eff4a64933ef10851ad0a989376088f2d5e;hpb=0f717ab8186382152b581c9dd67bf85779112e7f;p=ape.git diff --git a/R/klastorin.R b/R/klastorin.R index 27ba6ef..3d19128 100644 --- a/R/klastorin.R +++ b/R/klastorin.R @@ -1,59 +1,2 @@ -## klastorin.R (2003-05-26) - -## Klastorin's (1982) classifification method, applied to -## phylogenetic trees as suggested by Misawa and Tajima (2000) - -## Copyright 2003 Gangolf Jobb - -## This file is part of the R-package `ape'. -## See the file ../COPYING for licensing issues. - -########### PRIVATE ############## - -getMisawaTajima <- function() - .C("getMisawaTajima", result = integer(klastorin_nTips()), - PACKAGE = "ape")$result - -### functions to set and extract phylo tree ### - -buildTreeFromPhylo <- function(tree) { - lowerNodes <- tree$edge[,1] - upperNodes <- tree$edge[,2] - edgeLengths <- tree$edge.length - tipLabels <- tree$tip.label - .C("buildTreeFromPhylo", as.integer(lowerNodes), - as.integer(upperNodes), as.double(edgeLengths), - as.integer(length(edgeLengths)), - as.character(tipLabels), - as.integer(length(tipLabels)), - result = integer(1), PACKAGE = "ape" - )$result -} - -destroyTree <- function() - .C("destroyTree", result = integer(1), - PACKAGE = "ape")$result - -getError <- function() - .C("getError", result = integer(1), - PACKAGE = "ape")$result - -klastorin_nTips <- function() - .C("nTips", result = integer(1), - PACKAGE = "ape")$result - -########### PUBLIC ############## - klastorin <- function(phy) -{ - if (!inherits(phy, "phylo")) - stop("object \"phy\" is not of class \"phylo\"") - ## added by EP for the new coding of "phylo" (2006-10-04): - phy <- new2old.phylo(phy) - ## End - buildTreeFromPhylo(phy) - if (getError() !=0) stop("Could not load \"phylo\" object") - tmp <- getMisawaTajima() - destroyTree() - tmp -} + stop("the function klastorin has been removed from ape")