netClass: Network from Class List

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/netClass.R

Description

Returns an unweighted adjacency matrix with a '1' where observations are from the same class, '0' if from different classes based on a vector of class assingments.

Usage

1

Arguments

x

Numeric vector containing the class/cluster assignments

labels

Optional. Vector of labels for the individual observations

Details

Used for converting class/community assingments into an adjacency matrix.

Value

A square matrix is returned with the number of rows, columns equal to the length of x and in the same order. If lables is supplied, they will be used as the row/column names.

Author(s)

Shannon M. Bell

See Also

hclust{cutree}

Examples

1
2
3
4
5
 #using the USArrest dataset
 arrestCor<-cor(t(USArrests))
 tree<-cutree(hclust(as.dist(1-arrestCor), method='ward'), k=10)
 netClass(tree, labels=colnames(arrestCor))
 

NetComp documentation built on May 2, 2019, 8:15 a.m.

Related to netClass in NetComp...