[or-cvs] [ernie/master] Leave out current day in GetTor graphs.
karsten at torproject.org
karsten at torproject.org
Mon Feb 22 15:56:43 UTC 2010
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Mon, 22 Feb 2010 16:55:37 +0100
Subject: Leave out current day in GetTor graphs.
Commit: 86ed5d23d4aec6d5b2baba60cacf8256e868e4e3
---
R/gettor.R | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/R/gettor.R b/R/gettor.R
index b37b3ed..e140239 100644
--- a/R/gettor.R
+++ b/R/gettor.R
@@ -3,6 +3,8 @@ suppressPackageStartupMessages(library("ggplot2"))
gettor <- read.csv("stats/gettor-stats", header = TRUE,
stringsAsFactors = FALSE);
+start <- as.Date(min(gettor$date))
+end <- seq(from = Sys.Date(), length = 2, by = "-1 day")[2]
total <- data.frame(date = gettor$date,
packages = rowSums(gettor[2:length(gettor)]) - gettor$none)
en <- data.frame(date = gettor$date,
@@ -23,7 +25,7 @@ write.csv(data.frame(date = gettor$date,
plot_packages <- function(filename, title, data) {
ggplot(data, aes(x = as.Date(date, "%Y-%m-%d"), y = packages)) + geom_line() +
- scale_x_date(name = "") +
+ scale_x_date(name = "", limits = c(start, end)) +
scale_y_continuous(name = "",
limits = c(0, max(data$packages, na.rm = TRUE))) +
opts(title = paste(title, "\n", sep = ""))
--
1.6.5
More information about the tor-commits
mailing list