[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [ernie/master] Fix CSV with peak and average daily Tor user numbers.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed, 21 Jul 2010 10:06:07 +0200
Subject: Fix CSV with peak and average daily Tor user numbers.
Commit: e6a40aead86f82d25b11c9a0801322ea337be919

---
 R/monthly-users.R |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/R/monthly-users.R b/R/monthly-users.R
index 21c0afc..098b50d 100644
--- a/R/monthly-users.R
+++ b/R/monthly-users.R
@@ -8,9 +8,14 @@ if (file.exists("stats/dirreq-stats") &
   # Read direct user numbers
   dirreq <- read.csv("stats/dirreq-stats", header = TRUE,
     stringsAsFactors = FALSE)
-  trustedSub <- subset(dirreq,
-    directory %in% "8522EB98C91496E80EC238E732594D1509158E77")
-  trustedSub[na.omit(trustedSub$share) == 0,3:length(trustedSub)] <- NA
+  trustedSub <- dirreq[dirreq$directory ==
+    "8522EB98C91496E80EC238E732594D1509158E77",]
+  trustedSub[!is.na(trustedSub$share) & trustedSub$share < 0.01,
+    3:length(trustedSub)] <- NA
+  # Take out values in June 2010 when we had problems with dirreq-shares
+  trustedSub[!is.na(trustedSub$share) & trustedSub$date > "2010-05-26"
+             & trustedSub$date < "2010-06-24",
+    3:length(trustedSub)] <- NA
   trusted <- data.frame(date = trustedSub$date,
     floor(trustedSub[3:(length(trustedSub) - 1)] / trustedSub$share * 10))
 
-- 
1.7.1