[tor-commits] [metrics-web/master] Remove non-countries from country tables.

karsten at torproject.org karsten at torproject.org
Wed Aug 31 12:09:42 UTC 2011


commit 5e0a53ab0d99b17a4656543fb8878e37056e64ab
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed Aug 31 14:04:51 2011 +0200

    Remove non-countries from country tables.
    
    Some of the tables contained non-country codes like "??" and "ap" which
    were then resolved to "no-man's-land in the table.  These non-countries
    shouldn't be listed in the table at all.  Removing them.
    
    Fixes #3821.
---
 rserve/tables.R |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rserve/tables.R b/rserve/tables.R
index aabd588..b4ef535 100644
--- a/rserve/tables.R
+++ b/rserve/tables.R
@@ -18,7 +18,7 @@ write_direct_users <- function(start, end, path) {
                (u$bwr * u$brn / u$bwn - u$brr) / 10))
   d <- aggregate(d$directusers, by = list(country = d$country), mean)
   total <- d[d$country == "zy", "x"]
-  d <- d[d$country != "zy", ]
+  d <- d[!(d$country %in% c("zy", "??", "a1", "a2", "o1", "ap", "eu")), ]
   d <- data.frame(country = d$country, directusers = d$x)
   d <- d[order(d$directusers, decreasing = TRUE), ]
   d <- d[1:10, ]
@@ -60,6 +60,7 @@ write_censorship_events <- function(start, end, path) {
     downturn = ifelse(r$users < r$minusers, 1, 0))
   r <- aggregate(r[, c("upturn", "downturn")],
     by = list(country = r$country), sum)
+  r <- r[!(r$country %in% c("zy", "??", "a1", "a2", "o1", "ap", "eu")), ]
   r <- r[order(r$downturn, r$upturn, decreasing = TRUE), ]
   r <- r[1:10, ] 
   r <- data.frame(cc = r$country,



More information about the tor-commits mailing list