This repository contains the R code to reproduce some of the results in the study "Reconstructing signed relations from interaction data," published in Nature Scientific Reports. The φ-method introduced in this paper infers weighted signed relations—positive or negative social ties—from unsigned interaction data, such as proximity or communication logs.
For a comprehensive understanding of the methodology, findings, and implications of this study, please refer to the full paper.
The analysis utilizes different community datasets to validate the φ-method. These datasets include unsigned interaction data, which the method uses to infer the underlying signed social relations. Instructions on where to find the data are in the respective R files.
The repository contains two files that showcase how to apply the method to two different datasets:
- highschool.R
- karate.R
The directory 'functions' contains auxiliary functions.
The file requirements.txt
lists all required R packages to run this tutorial.
- Clone the repository to your local machine.
- Install the required R packages listed in
requirements.txt
from CRAN. - Install the R package adjHelpR from github (gi0na/adjHelpR).
- Run the R notebooks.
- R environment (version >= 4.0.0)
- Listed R packages in
requirements.txt
.
This project is licensed under the GNU AFFERO License - see the LICENSE.md file for details.
If you use the code or data in your research, please cite our paper as follows:
Andres, G., Casiraghi, G., Vaccario, G., and Schweitzer, F. Reconstructing signed relations from interaction data. Sci Rep 13, 20689 (2023). https://doi.org/10.1038/s41598-023-47822-1