R/partition.R

Defines functions partition

Documented in partition

partition <- function(x, dist, ...)
{
    UseMethod("partition")
}

partition.default <- function (x, dist, ...)
{
    if (class(dist) != 'dist') {
        stop("You must supply an object of class dist as the second argument")
    }
    x <- as.numeric(clustify(x))
    out <- list()
    attr(out,"call") <- match.call()
    out$diss <- dist
    out$clustering <- x
    out$silinfo <- silhouette(x,dist)
    attr(out,'class') <- 'partition'
    return(out)
}

Try the optpart package in your browser

Any scripts or data that you put into this service are public.

optpart documentation built on May 2, 2019, 3:27 a.m.