R/clustify.R

Defines functions clustify

Documented in clustify

clustify <- function(clustering)
{
    if (inherits(clustering,c("partana", "partition", "clustering"))) {
        clustering <- factor(clustering$clustering)
    } else if (is.character(clustering)) {
        clustering <- factor(clustering)
    } else if (is.numeric(clustering)) {
        clustering <- factor(clustering)
    } else if (is.logical(clustering)) {
        clustering <- factor(clustering)
    } else if (!is.factor(clustering)) 
        stop('Cannot understand passed clustering')
    clustering
}

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.