-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.r
60 lines (43 loc) · 1.2 KB
/
make.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# hi Belgium
source("load.r")
source("functions.r")
source("parties.r")
# folders
dir.create("data" , showWarnings = FALSE)
dir.create("plots" , showWarnings = FALSE)
if (file.exists("photos_ch.zip"))
unzip("photos_ch.zip")
dir.create("photos_ch", showWarnings = FALSE)
if (file.exists("photos_se.zip"))
unzip("photos_se.zip")
dir.create("photos_se", showWarnings = FALSE)
if (file.exists("raw.zip"))
unzip("raw.zip")
dir.create("raw", showWarnings = FALSE)
# parameters
years = c("47" = 1987, "48" = 1991, "49" = 1995, "50" = 1999, "51" = 2003,
"52" = 2007, "53" = 2010, "54" = 2014, "55" = 2019)
plot = TRUE
gexf = TRUE
mode = "fruchtermanreingold"
meta = c(
"cty" = "Belgium",
"lang" = "fr", # Wikipedia language for chamber and constituencies
"ch" = "Chambre_des_représentants_de_Belgique",
"se" = "Sénat_(Belgique)",
"type-ch" = "Lower",
"type-se" = "Upper",
"ipu-ch" = 2029,
"ipu-se" = 2030,
"seats-ch" = 150,
"seats-se" = 60
)
# build routine
source("data-ch.r")
source("build-ch.r")
source("comm-ch.r")
source("data-se.r")
source("build-se.r")
save(list = ls(pattern = "^(co)?(net|edges|bills)_be_(ch|se)\\d{4}$"),
file = "data/net_be.rda")
# have a nice day