From 1e5ddef18fa89015688f3b9d3dc30db35c2b8652 Mon Sep 17 00:00:00 2001 From: KonScience Podcast Date: Sun, 19 Oct 2014 08:58:52 +0200 Subject: [PATCH] converted qplot to colourful ggplot2 --- .gitignore | 1 + summarize-flattr-reports.R | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 69057df..19fba35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # History files .Rhistory +*.Rapp.history # Example code in package build process *-Ex.R diff --git a/summarize-flattr-reports.R b/summarize-flattr-reports.R index 9a49938..e969118 100644 --- a/summarize-flattr-reports.R +++ b/summarize-flattr-reports.R @@ -65,16 +65,15 @@ per_period <- ddply(raw, all_revenue = sum(revenue) ) -# plots Flattr clicks over time -# // TODO colorize by "title"-category +# plots Flattr clicks over time, colored by thing per_period$EUR_per_click <- (per_period$all_revenue / per_period$all_clicks) library(ggplot2) -qplot(x = per_period$period, - y = per_period$EUR_per_click, - xlab = "time", - ylab = "EUR per click" - ) -ggsave("flattr-revenue-clicks.png") +plot <- ggplot(data = per_period, aes(x = period, y = EUR_per_click, color = factor(title))) + + geom_point(size = 5) + + xlab("time") + + ylab("EUR per click") +plot +ggsave("flattr-revenue-clicks.png", height = 12, width = 12) # orders by title per_period_orderd <- per_period[order(per_period$title),]