edgel: Read and Transform Edge-Lists

edgelR Documentation

Read and Transform Edge-Lists

Description

A function to read edge lists as objects or files with a ‘sender-receiver-tie’ format representing multiplex networks and to transform edge-lists into three-dimensional arrays.

Usage

edgel(x, toarray = TRUE, header = TRUE, sep = "\t", valued = FALSE, inc = FALSE, 
      rownames = TRUE, add = NULL, na.rm)

Arguments

x

Object or file representing network data.

toarray

(logical) Transform edge-list in x into an array?

header

(optional and logical) Does edge-list in file x has a header?

sep

(default horizontal tab) Separator between edge-list columns.

valued

(logical, for toarray) Return a transformation of x as a valued network?

inc

(optional and logical) Is x an incidence matrix?

rownames

(optional and logical, for inc) Treat ‘rownames’ in x as actors/objects names? See details.

add

(optional) Vector with isolate labels to add to the output.

na.rm

(optional and logical) Remove NAs from x in the output?

Details

The edgel function reads edge lists in ‘sender-receiver-tie’ format as a data frame with at least two columns for sender and receiver, plus one column for each relation type in a multiplex network. For simple networks, two columns for sender and receiver are sufficient. The input in x may also be a file containing tabular data, where the separator and header are specified with sep and header.

The inc option is used for incidence matrices with actors or objects and self-ties in data frames, which are relevant for two-mode data and analyses such as Galois transformations between partite sets. Incidence matrices can be converted into diagonal matrices for further analysis. When toarray is set to FALSE, argument rownames can be used to move labels between row names and the first column.

Additional options make it possible to remove missing values with na.rm, add isolated nodes with add, and choose between dichotomizing or preserving values in networks with valued.

Value

By default the outcome is an array that for multiple networks is a three dimensions of stacked matrices where the relation types are placed. However, if toarray is set to FALSE, then the edge-list with a data frame format is returned. warning messages for missing information, with the tranformation type, and when ‘one type of relation assumed’ in x.

Note

For backwards compatibility, an alias for this fuction is read.srt.

See Also

write.edgel, galois, read.gml, read.dl


multiplex documentation built on July 30, 2026, 5:13 p.m.