Ticket #22235: hidserv-descs-per-hsdir.R

File hidserv-descs-per-hsdir.R, 795 bytes (added by karsten, 2 years ago)
Line 
1require(ggplot2)
2require(reshape)
3require(scales)
4theme_update(plot.title = element_text(hjust = 0.5))
5
6s5 <- read.csv("servers.csv", stringsAsFactors = FALSE)
7s5 <- s5[s5$flag == "HSDir", c("date", "relays")]
8h5 <- read.csv("hidserv.csv", stringsAsFactors = FALSE)
9h5 <- h5[h5$type == "dir-onions-seen", c("date", "wiqm")]
10m5 <- rbind(
11  data.frame(date = as.Date(s5$date), variable = "hsdirs", value = s5$relays),
12  data.frame(date = as.Date(h5$date), variable = "onions", value = h5$wiqm))
13m5 <- cast(m5)
14ggplot(m5, aes(x = date, y = 6 * onions / hsdirs)) +
15geom_line() +
16scale_x_date(name = "") +
17scale_y_continuous(name = "") +
18expand_limits(y = 0) +
19ggtitle("Average onion service descriptor count per directory\n")
20ggsave("hidserv-descs-per-hsdir.png", width = 8, height = 5, dpi = 100)
21