Skip to content

Commit

Permalink
converted qplot to colourful ggplot2
Browse files Browse the repository at this point in the history
  • Loading branch information
KonScience Podcast authored and KonScience Podcast committed Oct 19, 2014
1 parent 2d98989 commit 1e5ddef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# History files
.Rhistory
*.Rapp.history

# Example code in package build process
*-Ex.R
Expand Down
15 changes: 7 additions & 8 deletions summarize-flattr-reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),]
Expand Down

0 comments on commit 1e5ddef

Please sign in to comment.