l_comp: Retrieve largest component

Description Usage Arguments Value Examples

Description

Retrieves the largest component. In case of equally sized components the first is component is retrieved.

Usage

1
l_comp(adj, weights = NULL, mode = "undirected", igraph = FALSE)

Arguments

adj

numeric matrix representing the adjacency matrix.

weights

numeric vector of edge weights. Optional.

mode

character, either "directed" or "undirected", specifying whether the network should be interepeted as directed or undirected. Defaults to "undirected".

igraph

logical specifying whether the output should be of class "igraph".

Value

A list containing the, now, named adjacency matrix and a numeric value indicating the size of the largest component relative to to the entire graph.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# get fluency data
data(animal_fluency)

# edge list of fluency graph
edge_list = threshold_graph(animal_fluency[1:10])

# get adjacency matrix
adj = edg_to_adj(edge_list)

# get largest component
l_comp(adj)

memnet documentation built on May 2, 2019, 9:35 a.m.