https://github.com/pakillo/network.tools
Tools to work with bipartite networks
https://github.com/pakillo/network.tools
Last synced: 3 months ago
JSON representation
Tools to work with bipartite networks
- Host: GitHub
- URL: https://github.com/pakillo/network.tools
- Owner: Pakillo
- License: gpl-3.0
- Created: 2024-05-03T14:43:50.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-22T19:29:07.000Z (over 1 year ago)
- Last Synced: 2025-06-13T19:03:03.579Z (12 months ago)
- Language: R
- Homepage: https://pakillo.github.io/network.tools/
- Size: 1.52 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "60%"
)
```
# network.tools
[](https://github.com/Pakillo/network.tools/actions/workflows/R-CMD-check.yaml)
[](http://hits.dwyl.com/Pakillo/network.tools)
[](http://hits.dwyl.com/Pakillo/network.tools)
Tools to work with bipartite networks.
## Installation
You can install the development version of network.tools from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("Pakillo/network.tools")
```
## Usage
```{r }
library(network.tools)
```
### Network visualisation
#### Visualise bipartite network as heatmap
```{r }
data(web)
plot_web_heatmap(web)
```
Binarize the network (make it qualitative):
```{r}
plot_web_heatmap(web, binarize = TRUE)
```
The output is a ggplot object that can be further modified:
```{r}
plot_web_heatmap(web) +
ggplot2::labs(title = "A bipartite network")
```
### Data management
#### Transform interaction data from long to wide format
```{r}
head(web)
long2wide(web)
```
#### Transform interaction data from wide to long format
```{r}
mat <- long2wide(web)
wide2long(mat)
```
### Individual specialisation indices
Calculate indices of niche width and individual specialisation following [Bolnick et al. 2002](https://doi.org/10.1890/0012-9658(2002)083[2936:MILRS]2.0.CO;2).
```{r}
data(web)
net <- long2wide(web)
net
indiv_spec(net)
```
See the package [website](https://pakillo.github.io/network.tools) for more information.
## Citation
```{r warning=FALSE, comment=NA}
citation("network.tools")
```