Description Usage Arguments Value
Makes a graph (in the igraph
format) in which ties represent similarities between nodes, based on a matrix in which rows are cases (e.g., documents, authors, organizations), and columns are attributes of these cases (e.g., terms, authored-documents, countries).
Vertices (i.e. nodes) are defined as unique combinations of vertex.grouping.vars. If vertices cover multiple documents (e.g., authors of several documents) then content characteristics are first aggregated.
The (aggregated) content characteristics are used to calculate the similarities between vertices, for which various similarity measures can be used.
1 2 3 | similarity.graph(m, vertex.grouping.vars, similarity.measure = "cosine",
min.similarity = NULL, attributes.as.vertexmeta = NULL,
attributes.relative = T)
|
m |
A (sparse) matrix where rows represent cases and columns represent attributes. Similarities are calculated between cases based on their scores on attributes. For example, if rows are documents, and columns are terms (e.g., a |
vertex.grouping.vars |
Vectors of the same length and order as the rows of m, representing vertex/node characteristics. Each unique combination of characteristics will be considered a vertex. In the graph object these characteristics are stored as vertex attributes. |
similarity.measure |
A character string giving a method for computing similarity. Options (currently) are: 'correlation', 'cosine','conditional_probability','overlap_count' and 'overlap_jacard'. |
min.similarity |
A numeric scalar representing the threshold for similarities. All ties with a value below min.similarity will be deleted. Can be used to reduce the size of large graphs with many weak ties. |
attributes.as.vertexmeta |
Can be used to include the sum of values of attributes for each vertex as vertex meta. if 'all', all attributes will be included. Can also be a numeric vector to select specific attributes. If m has row names, these are used to name the attributes. Otherwise, they are labeled 'att' followed by the number (att1, att2, etc) |
attributes.relative |
Logical. If attributes.as.vertexmeta is used, should the summed attribute scores per vertex be made relative to all attribute scores of the vertex? |
A graph object in the igraph
format
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.