edge.list: Decompose an edge list

Description Usage Arguments Details Value Author(s) Examples

View source: R/rgexf.R

Description

Generates two data frames (nodes and edges) from a list of edges

Usage

1

Arguments

x

A matrix or data frame structured as a list of edges

Details

edge.list transforms the input into a two-elements list containing a dataframe of nodes (with columns “id” and “label”) and a dataframe of edges. The last one is numeric (with columns “source” and “target”) and based on auto-generated nodes' ids.

Value

A list containing two data frames.

Author(s)

George Vega Yon

Jorge Fabrega Lacoa

Examples

1
2
3
4
5
6
7
  edgelist <- matrix(
    c("matthew","john",
      "max","stephen",
      "matthew","stephen"),
    byrow=TRUE, ncol=2)
  
  edge.list(edgelist)

gvegayon/rgexf documentation built on Oct. 25, 2021, 4:21 p.m.