adjacency: Calculate adjacency of units

Description Usage Arguments Value

Description

Calculate the adjacency (or coincidence) of units based on the contexts in which the units occured, and optionally a value for how often they occured in this context. Various measures for calculating the adjacency/similarity are possible. Output is returned either as an adjacency matrix or as a graph in the igraph format.

Usage

1
2
adjacency(unit.vars, context, values = NULL, measure = "coincidence_count",
  as.graph = FALSE)

Arguments

unit.vars

Vectors representing the units. Can be a single vector or multiple vectors (as a data.frame or list). Units are then defined as unique combinations of vectors (e.g., first and last name of a person)

context

A vector representing the context in which the units occured. For instance, conversations in which they participated or communities they are members of.

values

Optional, a numerical vector with values for how often a unit occured in the context.

measure

The measure for adjacency that is used. Use 'coincidence_count' to get the number of context in which units co-occured. To take into account how many times units co-occured in the same context, 'cosine' is advised.

as.graph

Logical. If TRUE, the output is returned as a graph. Otherwise output is a list containing the adjacency matrix and vectors representing its rows/columns

Value

Either a list containing the adjacency matrix and vectors representing the rows/columns, or a graph (if as.graph == T)


kasperwelbers/network-tools documentation built on May 20, 2019, 7:38 a.m.