Created
February 14, 2016 22:55
-
-
Save altras/7ab3f0590fbaabb4a3fa to your computer and use it in GitHub Desktop.
Create a github style punchcard with a 1 line csv of commits with git log --pretty=format:"%ci"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(lubridate) | |
library(ggplot2) | |
dates <- read.csv("2015-commits.csv", header = FALSE, stringsAsFactors = FALSE) | |
dates_parsed <- parse_date_time(dates, "%y-%m-%d %h:%M:%S %z") | |
cmtHours <- factor(hour(dates_parsed)) | |
wkday <- factor(weekdays(dates_parsed), levels=c("понеделник", "вторник", "сряда", "четвъртък", "петък", "събота", "неделя")) | |
commits <- data.frame(cmtHours, wkday) | |
commits$freq <- apply(commits, 1, function(row) sum(row[1] == commits$cmtHour & row[2] == commits$wkday)) | |
ggplot(commits, aes(commits$cmtHour, commits$wkday)) + geom_point(size=commits$freq / 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment