2 data <- read.csv("hsdir-sessions.csv", stringsAsFactors = FALSE)
4 ## Histogram; not that useful
5 #ggplot(data, aes(x = duration / 3600)) +
6 #geom_histogram(aes(y = ..density..), binwidth = 1) +
7 #scale_x_continuous(limits = c(0, 72)) +
8 #scale_y_continuous(formatter = "percent")
10 data <- sort(data$duration)
11 data <- data.frame(x = data / (60 * 60),
12 y = (length(data):1) / length(data))
13 ggplot(data, aes(x = x, y = y)) +
15 scale_y_continuous("Cumulative fraction of continuous HSDir sessions\n",
16 formatter = "percent", limits = c(0, 1)) +
17 scale_x_continuous(paste("\nHSDir session time between the relay earning",
18 "the HSDir flag and going away in hours"),
19 limits = c(0, 3 * 24), breaks = seq(0, 3 * 24, 24))
20 ggsave(filename = "hsdir-sessions.png", width = 8, height = 5, dpi = 72)