From: paradis Date: Fri, 18 Jul 2008 17:28:17 +0000 (+0000) Subject: correcting 2 bugs in new dist.gene() X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2ea4987c5b870331f518b26da889eaf1d18dab55;p=ape.git correcting 2 bugs in new dist.gene() git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@46 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/R/dist.gene.R b/R/dist.gene.R index ea17b9b..650715e 100644 --- a/R/dist.gene.R +++ b/R/dist.gene.R @@ -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"