complexnet
Website for the R package 'complexNet' that generates and iterates complex networks based on heritable linking traits in agent-based simulations.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: nature.com, science.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.4%) to scientific vocabulary
Keywords
Repository
Website for the R package 'complexNet' that generates and iterates complex networks based on heritable linking traits in agent-based simulations.
Basic Info
Statistics
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Generating and Iterating Complex Networks
complexNet 
complexNet provides functions to easily generate and iterate complex networks. These networks rely on socially inherited and random connections to members of a population, as presented by Ilany & Akcay (2016). Their modelling framework has been shown to generate realistic networks with a wide range of different clustering, density, and average path length. In Smolla & Akcay (2019) we have used the same algorithms to generate networks and have them dynamically evolve.
Installation
```r
Install release version from CRAN
install.packages("complexNet")
Install development version from GitHub
devtools::install_github("marcosmolla/complexNet") ```
What are complex networks?
The general idea of complex networks (in the sense of this package) is that each individual of a group has a set of parameters that determines its probability to share an edge with certain subsets of the population. The most common version differentiates three subsets: the parent, the direct network neighbours of the parent, and everyone else. The probability to form a connection with the parent is given by the probability $pb$. Similarly, $pn$ is the probability to have a connection with the neighbours of the parent, and $p_r$ is the probability to connect to anyone else. Because these probabilities regard different subsets of the population, they do not have to add up to 1. So far, the algorithm is only working for asexual populations (a single parent) but will be extended to also include a two parents version in the future.
Usage
To generate a complex network, use the make_bnr() function. You need to set the number of individuals in the network n, and their linking probabilities pb, pn, and pr (see an example below). To set up a new network set np=c(0,0), which means that there is no ID set for who the newborn and the parent will be. Take a look at the vignette (in Articles at the top) to see how these networks can be iterated to simulate network dynamics and parameter evolution.
```r
Load library
library(complexNet)
Create adjacency matrix for a complex network
ADJM <- make_bnr(n = 10, np = c(0,0), pb = 1, pn = .2, pr = .02)
Load igraph library
library(igraph)
Convert adjacency matrix to an igraph network
G <- graphfromadjacency_matrix(ADJM)
Plot network
plot(G) ```
Example
Below is an example plot of networks generated with make_bnr() and for different social inheritance, $pn$, and random linking, $pr$, probabilities. As the linking probabilities increase, the networks become more connected.

The following code generates a similar figure to the one shown here.
```r
Load library
library(complexNet) library(igraph)
par(mfrow=c(3,3), mar=rep(1.2,4)) apply(X = expand.grid(c(.1,.3,.5), c(0.01,0.03,0.05)), 1, function(p) { # Create adjacency matrix for a complex network ADJM <- makebnr(n = 50, np = c(0,0), pb = 1, pn = p[1], pr = p[2]) # Convert adjacency matrix to an igraph network G <- graphfromadjacencymatrix(ADJM) # Calculate node degree centrality deg <- degree(G) # Select node colour based on its degree centrality V(G)$color <- heat.colors(rev = T, n = 25)[deg+1] # Plot network plot(G, main=paste("pn: ",p[1],", pr:",p[2], sep=""), vertex.label=NA, vertex.size=10, edge.arrow.size=0, vertex.color=V(G)$color) }) ```
Out there
Here is a list of articles that use complex networks:
Ilany, A., & Akcay, E. (2016). Social inheritance can explain the structure of animal social networks. Nature Communications, 7(May), 1–23. https://doi.org/10.1101/026120
Ilany, A., & Akçay, E. (2016). Personality and Social Networks: A Generative Model Approach. Integrative and Comparative Biology, 56(6), 1197–1205. https://doi.org/10.1093/icb/icw068
Smolla, M., & Akçay, E. (2019). Cultural selection shapes network structure. Science Advances, 5(8), eaaw0609. https://doi.org/10.1126/sciadv.aaw0609
How to cite this package?
```r
citation("complexNet")
To cite package ‘complexNet’ in publications use:
Smolla M (2022). complexNet: Complex Network Generation. R package version 0.2.0. https://CRAN.R-project.org/package=complexNet
A BibTeX entry for LaTeX users is
@Manual{, title = {complexNet: Complex Network Generation}, author = {Marco Smolla}, year = {2022}, note = {R package version 0.2.0}, url = {https://CRAN.R-project.org/package=complexNet}, } ```
Owner
- Name: Marco Smolla
- Login: marcosmolla
- Kind: user
- Location: Leipzig
- Company: MPI Evolutionary Anthropology
- Website: marcosmolla.com
- Repositories: 10
- Profile: https://github.com/marcosmolla
Behavioural and evolutionary biologist. Interest in cultural evolution. Post-Doc in the Theory in Cultural Evolution Lab at the MPI (EVA) in Leipzig
GitHub Events
Total
Last Year
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 46
- Total Committers: 2
- Avg Commits per committer: 23.0
- Development Distribution Score (DDS): 0.022
Top Committers
| Name | Commits | |
|---|---|---|
| Marco Smolla | m****0@m****m | 45 |
| Maëlle Salmon | m****n@y****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- maelle (1)
- marcosmolla (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 269 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: complexNet
Complex Network Generation
- Homepage: https://marcosmolla.github.io/complexNet/
- Documentation: http://cran.r-project.org/web/packages/complexNet/complexNet.pdf
- License: GPL-3
-
Latest release: 0.2.0
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- methods * imports
- knitr * suggests
- rmarkdown * suggests
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite