Update criteria for partial/full IPv6 support.
[tor-metrics-tasks.git] / task-8462 / merge-clients.R
blob4a32ff1f4726a4b9a9d45d3154f0af010b95b74f
1 require(reshape)
2 r <- read.csv("userstats-ranges.csv", stringsAsFactors = FALSE)
3 r <- melt(r, id.vars = c("date", "country"))
4 r <- data.frame(date = r$date, node = "relay", country = r$country,
5   transport = "", version = "",
6   variable = ifelse(r$variable == "maxusers", "upper", "lower"),
7   value = floor(r$value))
8 u <- read.csv("userstats.csv", stringsAsFactors = FALSE)
9 u <- melt(u, id.vars = c("date", "node", "country", "transport",
10   "version"))
11 u <- data.frame(date = u$date, node = u$node, country = u$country,
12   transport = u$transport, version = u$version,
13   variable = ifelse(u$variable == "frac", "frac", "clients"),
14   value = u$value)
15 c <- rbind(r, u)
16 c <- cast(c, date + node + country + transport + version ~ variable)
17 c <- c[order(c$date, c$node, c$country, c$transport, c$version), ]
18 write.csv(c, "clients.csv", quote = FALSE, row.names = FALSE, na = "")