Skip to content

coofg

Co-offending graph from an incident table

coofg(inc, off)

The one-mode projection of offenders onto incidents: two offenders are joined when they are recorded in the same incident, and the weight of the tie is the number of incidents they share. An offender recorded twice in one incident counts once there. Offenders who never offend with anyone appear in nodes but in no edge; give nodes to the network functions to keep them as isolated nodes.

inc

Incident identifiers, one per row: a vector of labels with no missing values.

off

Offender identifiers, one per row: labels, same length.

A list: edges, a data frame with from, to (offender labels) and w (incidents shared), and nodes, every offender in order of first appearance.

Ties are listed in the order each pair is first met: incidents in the order they first appear, and within an incident the pairs of its offenders in the order of the rows; from is the offender who appears first in off. Labels are compared as text (as.character(); a factor by its labels).

Reiss, A. J. (1988). Co-offending and criminal careers. Crime and Justice, 10, 117-170. doi:10.1086/449145

g <- coofg(inc = c(1, 1, 1, 2, 2, 3), off = c("a", "b", "c", "a", "b", "d"))
g$edges
ntdeg(g$edges$from, g$edges$to, w = g$edges$w, nodes = g$nodes)

Generated from the R help page: coofg in the R reference.