Skip to content

Commit 9ce45e9

Browse files
committed
corrected a few bugs + refactoring
1 parent 416ec80 commit 9ce45e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5677
-6347
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ NaNet is free software: you can redistribute it and/or modify it under the terms
1313

1414
-----------------------------------------------------------------------
1515

16+
If you use this source code or the associated dataset, please cite reference [L'22].
1617

1718
# Description
1819
This set of R scripts aims at extracting and analyzing character networks extracted from graphic novels. It actually works on manually constituted CSV files, so in theory the work of fiction could be anything besides graphic novels, provided the input format is enforced.
@@ -24,7 +25,7 @@ The script does the following:
2425

2526

2627
# Data
27-
The raw dataset was manually for bande dessinée [Thorgal](https://en.wikipedia.org/wiki/Thorgal). The files produced by the scripts (graphs, plots, tables...) can be obtained by running these scripts, but they are also directly available on [Zenodo](https://doi.org/10.5281/zenodo.6395874).
28+
The raw dataset was manually constituted based on bande dessinée [Thorgal](https://en.wikipedia.org/wiki/Thorgal). The output files (graphs, plots, tables...) can be obtained by running the scripts, but they are also directly available on [Zenodo](https://doi.org/10.5281/zenodo.6395874).
2829

2930
![ThorgalStaticNet](/data/Thorgal/network.svg)
3031

@@ -51,12 +52,12 @@ You first need to install `R` and the required packages:
5152
3. Install the required packages:
5253
1. Open the `R` console.
5354
2. Set the unzipped directory as the working directory, using `setwd("<my directory>")`.
54-
3. Run the install script `src/install.R` (that may take a while).
55+
3. Run the install script `src/_install.R` (that may take a while).
5556

56-
A part of the analysis requires to compile some C code. The main instructions are in `src\pli\README.txt`, then follow the instructions in the following files (look for the TODOs):
57-
1. `src\pli\zeta.R/`: concerns the files in folder `src\pli\zeta-function`.
58-
2. `src\pli\powerexp.R`: concerns the files in folder `src\pli\exponential-integral`.
59-
3. `src\pli\discpowerexp.R`: concerns the file in folder `\src\pli\discpowerexp`.
57+
A part of the analysis requires to compile some `C` code. The main instructions are in `src/common/stats/pli/README.txt`, then follow the instructions in the following files (look for the TODOs):
58+
1. `src/common/stats/pli/zeta.R/`: concerns the files in folder `src/common/stats/pli/zeta-function`.
59+
2. `src/common/stats/pli/powerexp.R`: concerns the files in folder `src/common/stats/pli/exponential-integral`.
60+
3. `src/common/stats/pli/discpowerexp.R`: concerns the file in folder `\src/common/stats/pli/discpowerexp`.
6061

6162

6263
# Use
@@ -68,7 +69,7 @@ In order to extract the networks from the raw data, compute the statistics, and
6869

6970
The scripts will produce a number of files in the subfolders of folder `nets`. They are grouped in subsubfolders, each one corresponding to a specific topological measure (degree, closeness, etc.).
7071

71-
The script `src/Labatut2022.R` reproduces the computations described in article [[L'22](#references)]. Please, use [v1](https://github.com/CompNet/NaNet/releases/tag/v1) of the source code in the *Releases* page. Be warned that this will take a while (possibly several days). You can directly retrieve the data resulting from this process on [Zenodo](https://doi.org/10.5281/zenodo.6395875).
72+
The script `src/Labatut2022.R` reproduces the computations described in article [[L'22](#references)]. Please, use [v1.0.2](https://github.com/CompNet/NaNet/releases/tag/v1.0.2) of the source code in the *Releases* page. Be warned that this will take a while (possibly several days). You can directly retrieve the data resulting from this process on [Zenodo](https://doi.org/10.5281/zenodo.6573491).
7273

7374

7475
# Dependencies
@@ -101,4 +102,4 @@ Tested with `R` version 4.0.5, with the following packages:
101102

102103

103104
# References
104-
* **[L'22]** Labatut, V. *Complex Network Analysis of a Graphic Novel: The Case of the Bande Dessinée Thorgal*, submitted.
105+
* **[L'22]** Labatut, V. *Complex Network Analysis of a Graphic Novel: The Case of the Bande Dessinée Thorgal*, Advances in Complex Systems, p.22400033, 2022. [⟨hal-03694768⟩](https://hal.archives-ouvertes.fr/hal-03694768) - DOI: [10.1142/S0219525922400033](http://doi.org/10.1142/S0219525922400033)

TODO.txt

Lines changed: 0 additions & 99 deletions
This file was deleted.

res/pli/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Labatut2022.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# 03/2022
99
#
1010
# setwd("~/vlabatut/Eclipse/workspaces/Networks/NaNet")
11-
# setwd("C:/Users/Vincent/Eclipse/workspaces/Networks/NaNet")
11+
# setwd("D:/Users/Vincent/Eclipse/workspaces/Networks/NaNet")
1212
# source("src/Labatut2022.R")
1313
###############################################################################
1414

@@ -24,7 +24,7 @@ SERIES <- "Thorgal"
2424

2525
###############################################################################
2626
# load scripts
27-
source("src/common/include.R")
27+
source("src/common/_include.R")
2828

2929
# start logging
3030
start.rec.log(text=SERIES)
@@ -34,25 +34,25 @@ start.rec.log(text=SERIES)
3434

3535
###############################################################################
3636
# read raw data
37-
#data <- read.raw.data()
37+
data <- read.raw.data()
3838
# OR, if already computed, read from file
39-
data <- read.corpus.data()
39+
#data <- read.corpus.data()
4040

4141
# compute corpus stats
42-
#data <- compute.corpus.stats(data)
42+
data <- compute.corpus.stats(data)
4343

4444
# plot corpus stats
45-
#plot.corpus.stats(data)
45+
plot.corpus.stats(data)
4646

4747

4848

4949

5050
###############################################################################
5151
# extract static networks
52-
#data <- extract.static.graphs.base(data)
52+
data <- extract.static.graphs.base(data)
5353

5454
# plot these graphs
55-
#plot.static.graphs(data)
55+
plot.static.graphs(data)
5656

5757

5858

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
#############################################################################################
2-
# Install all the packages necessary to these scripts.
3-
#
4-
# See also src/common/distr_test.R to compile the C programs required for power law fitting.
5-
#
6-
# 09/2019 Vincent Labatut
7-
#
8-
# source("src/install.R")
9-
#############################################################################################
10-
11-
12-
13-
14-
# graph computing
15-
install.packages("igraph")
16-
# harmonic closeness
17-
install.packages("CINNA")
18-
# block modeling
19-
install.packages("blockmodeling")
20-
21-
# parallel computation
22-
#install.packages("foreach")
23-
install.packages("future.apply")
24-
install.packages("doParallel")
25-
26-
# various plots
27-
install.packages("ggplot2")
28-
install.packages("ggExtra")
29-
install.packages("sfsmisc")
30-
# violin plots
31-
install.packages("vioplot")
32-
# colors
33-
install.packages("viridis")
34-
install.packages("SDMTools")
35-
36-
# statistical tests
37-
install.packages("ercv")
38-
install.packages("poweRlaw")
39-
install.packages("perm")# permutation test
40-
# nonlinear regression
41-
install.packages("minpack.lm")
42-
43-
# strings
44-
install.packages("stringr")
45-
install.packages("latex2exp")# insert latex code in plot texts
46-
47-
# polynomials
48-
install.packages("polynom")
49-
50-
# various fast functions (including binary search)
51-
#install.packages("Rfast") # not used
52-
install.packages("data.table")
53-
54-
# clustering
55-
install.packages("cluster")
56-
1+
#############################################################################################
2+
# Install all the packages necessary to these scripts.
3+
#
4+
# See also src/common/stats/distr_test.R to compile the C programs required for power law fitting.
5+
#
6+
# 09/2019 Vincent Labatut
7+
#
8+
# source("src/_install.R")
9+
#############################################################################################
10+
11+
12+
13+
14+
# graph computing
15+
install.packages("igraph")
16+
# harmonic closeness
17+
install.packages("CINNA")
18+
# block modeling
19+
install.packages("blockmodeling")
20+
21+
# parallel computation
22+
#install.packages("foreach")
23+
install.packages("future.apply")
24+
install.packages("doParallel")
25+
26+
# various plots
27+
install.packages("ggplot2")
28+
install.packages("ggExtra")
29+
install.packages("sfsmisc")
30+
# violin plots
31+
install.packages("vioplot")
32+
# colors
33+
install.packages("viridis")
34+
install.packages("SDMTools")
35+
36+
# statistical tests
37+
install.packages("ercv")
38+
install.packages("poweRlaw")
39+
install.packages("perm")# permutation test
40+
# nonlinear regression
41+
install.packages("minpack.lm")
42+
43+
# strings
44+
install.packages("stringr")
45+
install.packages("latex2exp")# insert latex code in plot texts
46+
47+
# polynomials
48+
install.packages("polynom")
49+
50+
# various fast functions (including binary search)
51+
#install.packages("Rfast") # not used
52+
install.packages("data.table")
53+
54+
# clustering
55+
install.packages("cluster")
56+

0 commit comments

Comments
 (0)