subg: Subgraph of a graph.

Description Usage Arguments Value Author(s) Examples

View source: R/Supplements.R

Description

Creates a subgraph containing only nodes specified from a data frame, including all edges among neighbors.

Usage

1
subg(g, dat, refcol=1, maincomp=TRUE, connected=TRUE, transdat=TRUE)

Arguments

g

An igraph object.

dat

A data frame with node ids and attributes to be mapped to 'g'.

refcol

The reference column (node ids) in the 'dat' object.

maincomp

Logical value, whether to return only the main component of the subgraph.

connected

Logical value, whether to return only connected nodes.

transdat

Logical value, whether to transfer node attributes from the 'dat' object to the subgraph.

Value

Returns a igraph object.

Author(s)

Mauro Castro

Examples

1
2
3
data(hs.inter)
data(ER.deg)
#subnet <- subg(g=hs.inter, dat=ER.deg$dat, refcol=1)

RedeR documentation built on Nov. 8, 2020, 7:45 p.m.