Skip to content

Commit 1e5ddef

Browse files
KonScience PodcastKonScience Podcast
authored andcommitted
converted qplot to colourful ggplot2
1 parent 2d98989 commit 1e5ddef

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# History files
22
.Rhistory
3+
*.Rapp.history
34

45
# Example code in package build process
56
*-Ex.R

summarize-flattr-reports.R

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,15 @@ per_period <- ddply(raw,
6565
all_revenue = sum(revenue)
6666
)
6767

68-
# plots Flattr clicks over time
69-
# // TODO colorize by "title"-category
68+
# plots Flattr clicks over time, colored by thing
7069
per_period$EUR_per_click <- (per_period$all_revenue / per_period$all_clicks)
7170
library(ggplot2)
72-
qplot(x = per_period$period,
73-
y = per_period$EUR_per_click,
74-
xlab = "time",
75-
ylab = "EUR per click"
76-
)
77-
ggsave("flattr-revenue-clicks.png")
71+
plot <- ggplot(data = per_period, aes(x = period, y = EUR_per_click, color = factor(title))) +
72+
geom_point(size = 5) +
73+
xlab("time") +
74+
ylab("EUR per click")
75+
plot
76+
ggsave("flattr-revenue-clicks.png", height = 12, width = 12)
7877

7978
# orders by title
8079
per_period_orderd <- per_period[order(per_period$title),]

0 commit comments

Comments
 (0)