Learn R Programming

shp2graph (version 1-0)

ME.simplification: Simplify multiple edges in a network

Description

A function to simplfy multiple-edge into one representative edge, where a multiple-edge structure refers to a set of edges sharing with the same pair of nodes.

Usage

ME.simplification(nodelist, edgelist, eadf=NULL, ea.prop=NULL, Directed=F, 
                  DegreeL=NULL, InDegreeL=NULL, OutDegreeL=NULL,Nexception=NULL,
                  Eexception=NULL)

Value

Two types of list returned for undirected and directed edges, respectively:

For “undirected” edges:

newNodelist

New node list with multiple-edges simplified;

newEdgelist

New edge list with multiple-edges simplified;

newEadf

New attribute data frame for the returned edgelist;

DegreeL

New degree vector cooresponding to the newly returned node list;

For “directed” network:

newNodelist

New node list with multiple-edges simplified;

newEdgelist

New edgelist with multiple-edges simplified;

newEadf

Data frame of attributes for the newly returned edge list;

InDegreeL

New In-degree vector cooresponding to the newly returned node list;

OutDegreeL

New Out-degree vector cooresponding to the newly returned node list;

Arguments

nodelist

A “nodelist” object;

edgelist

An “edgelist” object

eadf

A data frame of attributes corresponding to all the edges;

ea.prop

A vector (of the length equalling to the number of edge attributes in “eadf”) with values of 1, 2, 3 or 4, and each specific value represent a function to assign the attributes of the edited edges, see also Redef.functions:

1->sum(v)

2->min(v)

3->max(v)

4->mean(v)

Directed

TRUE if edges are directed, FALSE otherwise;

DegreeL

An integer vector of degrees for each node in the given “nodelist”, and it could be ignored if edges are directed

InDegreeL

An integer vector of In-degrees for each node in the given “nodelist”, and it could be ignored if edges are undirected

OutDegreeL

An integer vector of Out-degrees for each node in the given “nodelist”, and it could be ignored if edges are undirected

Nexception

A vector of node IDs concerned as exceptions, and all the edges with these nodes included won't be processed;

Eexception

A vector of edge IDs concerned as exceptions, and all these edges won't be processed;

Author

Binbin Lu binbinlu@whu.edu.cn

See Also

SL.extraction, PN.amalgamation