Learn R Programming

shp2graph (version 0-2)

SL.extraction: Extract self-loops form given network

Description

This function is to extract self-loops away in given network.

Usage

SL.extraction(nodelist, edgelist, eadf=NULL,Directed=F, DegreeL=NULL, 
              InDegreeL=NULL, OutDegreeL=NULL,Nexception=NULL,Eexception=NULL)

Arguments

nodelist

A nodelist object, see nodelist;

edgelist

An edgelist object, see edgelist;

eadf

Attribute data frame for all the edges;

Directed

A logical parameter to specify whether edges are directed or not;

DegreeL

A vector (of length equal to the number of nodes) of degrees for the nodes, and it should be null if “Directed” is TRUE;

InDegreeL

A vector (of length equal to the number of nodes) of in-degrees for the nodes;

OutDegreeL

A vector of out-degrees for the nodes;

Nexception

A vector of node IDs considered as exceptions, and all the nodes included won't be processed;

Eexception

A vector of edge IDs considered as exceptions, and all the edges included won't be processed;

Value

Two types of list for undirected and directed edges respectively: For undirected type:

newNodelist

The new “nodelist” with self-loops extracted;

newEdgelist

The new “edgelist” with self-loops extracted;

newEadf

The new attribute data frame for the amended edgelist;

DegreeL

The new degree vector cooresponding to the returned nodelist;

For directed type:
newNodelist

The new “nodelist” with self-loops extracted;

newEdgelist

The new “edgelist” with self-loops extracted;

newEadf

The new attribute data frame for the returned edgelist;

InDegreeL

The new in-degree vector cooresponding to the returned “nodelist”;

OutDegreeL

The new out-degree vector cooresponding to the returned “nodelist”;

Details

If edges in the “edgelist” are directed, the InDegreeL and OutDegreeL will be calculated (if not given) and updated synchronized with self-loop extration; otherwise only DegreeL is returned.

See Also

PN.amalgamation, ME.simplification