]> git.donarmstrong.com Git - ape.git/commitdiff
correcting 2 bugs in new dist.gene()
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 18 Jul 2008 17:28:17 +0000 (17:28 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 18 Jul 2008 17:28:17 +0000 (17:28 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@46 6e262413-ae40-0410-9e79-b911bd7a66b7

R/dist.gene.R

index ea17b9b577a37c3cc617d552d9e5bfa5d8eb3465..650715e7a9976aacee8225d9456e6ae06bc71850 100644 (file)
@@ -11,7 +11,7 @@ dist.gene <-
     function(x, method = "pairwise", pairwise.deletion = FALSE,
              variance = FALSE)
 {
-    if (!is.data.frame(x) || !is.matrix(x))
+    if (!is.data.frame(x) && !is.matrix(x))
         stop("'x' should be a matrix or a data.frame")
     method <- match.arg(method, c("pairwise", "percentage"))
 
@@ -41,7 +41,7 @@ dist.gene <-
 
     attr(D, "Size") <- n
     attr(D, "Labels") <-  dimnames(x)[[1]]
-    attr(D, "Diag") <- attr(d, "Upper") <- FALSE
+    attr(D, "Diag") <- attr(D, "Upper") <- FALSE
     attr(D, "call") <- match.call()
     attr(D, "method") <- method
     class(D) <- "dist"