R/partition.R

Defines functions partition

Documented in partition

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

partition.default <- function (x, dist, ...)
{
    if (!inherits(dist,'dist')) {
        stop("The second argument must be an object of class 'dist'")
    }
    x <- as.numeric(clustify(x))
    out <- list()
    out$diss <- dist
    out$clustering <- x
    out$silinfo <- silhouette(x,dist)
    attr(out,'class') <- 'partition'
    attr(out,"call") <- match.call()
    attr(out,'timestamp') <- date()
    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 March 26, 2020, 6:18 p.m.