Nothing
#' Label matrix
#'
#' Convert class indicator into a label maxtrix.
#' @param clust An n-dimensional vector of class partition.
#' @return
#' \item{Z}{ A matrix of class indicator.}
#' @examples
#' cluster<-c(1,1,2,2,3,3)
#' label_maxtrix<-makelabelmatrix(cluster)
#' @export
makelabelmatrix <- function(clust){
n <- length(clust)
g <- max(clust)
Z <- matrix(0, n, g)
index <- cbind(1:n, clust)
Z[index] <- 1
return(Z)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.