Description Usage Arguments Details Value Author(s) References Examples

`localModularity`

uses the local modularity to identify the local community structure around a certain vertex

`localModularityWang`

uses the local modularity to identify the community structure of the entire network

1 2 | ```
localModularity(adjacency, srcV, k)
localModularityWang(adjacency,numRandom=0)
``` |

`adjacency` |
A nonnegative symmetric adjacency matrix of the network whose community structur will be analyzed |

`srcV` |
A given vertex whose local community structure should be determined by |

`k` |
The maximum number of vertices to add to the local community of |

`numRandom` |
The number of random networks with which the modularity of the resulting community structure should be compared (default: no comparison). see details below for further explanation of the used null model. |

The used random networks have the same number of vertices and the same degree distribution as the original network.

The result for `localModularity`

is returned as a list with the following components

`local community` |
Vertices assigned to the same community as the source vertex |

`local modularity` |
The local modularity value for the determined local community |

The result for `localModularityWang`

is returned as a list with the following components

`number of communities` |
The number of communities detected by the algorithm |

`modularity` |
The modularity of the detected community structure |

`mean` |
The mean of the modularity values for random networks, only computed if |

`standard deviation` |
The standard deviation of the modularity values for random networks, only computed if |

`community structure` |
The community structure of the examined network given by a vector assigning each vertex its community number |

`random modularity values` |
The list of the modularity values for random networks, only computed if |

Maria Schelling, Cang Hui

Clauset, A. Finding local community structure in networks. *Phys. Rev.
E*, 72:026132, Aug 2005.

Wang, X., Chen, G. and Lu, H. A very fast algorithm for detecting community structures in complex networks. *Physica A: Statistical Mechanics and its Applications*, 384(2):667-674, 2007.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
#unweighted network
randomgraph1 <- erdos.renyi.game(10, 0.3, type="gnp",directed = FALSE, loops = FALSE)
#to ensure that the graph is connected
vertices1 <- which(clusters(randomgraph1)$membership==1)
graph1 <- induced.subgraph(randomgraph1,vertices1)
adj1 <- get.adjacency(graph1)
result1 <- localModularity(adj1, srcV=1, k=4)
#weighted network
randomgraph2 <- erdos.renyi.game(10, 0.3, type="gnp",directed = FALSE, loops = FALSE)
#to ensure that the graph is connected
vertices2 <- which(clusters(randomgraph2)$membership==1)
graph2 <- induced.subgraph(randomgraph2,vertices2)
graph2 <- set.edge.attribute(graph2, "weight", value=runif(ecount(graph2),0,1))
adj2 <- get.adjacency(graph2, attr="weight")
result2 <- localModularityWang(adj2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.