list2adjmat: Convert a list to an adjacency matrix

Description Usage Arguments Value Author(s) Examples

Description

If x is a list of variably lengthed vectors, then return a table which has the unique values as the rownames, and the names(x) as the colnames, with either a 0 or 1 depending on whether the entity in row i was found in the vector in column j. Sorted by decreasing frequency across the list of vectors (ie row 1 contains the word that was found in the most number of vectors in list x)

Usage

1

Arguments

x

a named list, where each element is a character vector. If it's unnamed, names will be assigned

Value

a data.frame of 0 or 1, where rows correspond to unique words, columns represent each list element.

Author(s)

Mark Cowley, 2009-10-29

Examples

1
2
mylist <- list(A=letters[1:15], B=letters[10:26], C=letters[15:20])
list2adjmat(mylist)

drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.