function(x, method = "pairwise", pairwise.deletion = FALSE,
variance = FALSE)
{
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"))
stop("'x' should be a matrix or a data.frame")
method <- match.arg(method, c("pairwise", "percentage"))
attr(D, "Size") <- n
attr(D, "Labels") <- dimnames(x)[[1]]
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"
attr(D, "call") <- match.call()
attr(D, "method") <- method
class(D) <- "dist"