50000 Revisions Committed to R | /en/2009/10/50000-revisions-committed-to-r/
50000 Revisions Committed to R
https://yihui.org/en/2009/10/50000-revisions-committed-to-r/
https://yihui.org/en/2009/10/50000-revisions-committed-to-r/
Guest *Kevin Wright* @ 2009-10-27 01:12:58 originally posted:
I don't use ggplot2, so maybe I'm wrong, but it does not appear that ggplot2 is respecting the bin width of 1 hour. Here is an equal-bin-width version using lattice:
library(lattice)
histogram(~hour, data = subset(hour.data, author == "ripley"),
type="count",
breaks=0:24-.1,
scales=list(x=list(at=c(0,6,12,18,24)))
)
Your graph does a nice job of answering the question. Ripley usually quits working by 12:00 and almost always by 1:00 AM. He almost never starts before 5:00 AM.
Shifting the 'window' from 0-24 hours to 4-28 hours provides a different (more natural?) perspective on Ripley's 'day':
hour2 <- subset(hour.data, author == "ripley")
hour2$hour <- ifelse(hour2$hour < 4, hour2$hour + 24, hour2$hour)
histogram(~hour, data = hour2,
type="count",
breaks=4:30-.1,
scales=list(x=list(at=c(0,6,12,18,24)))
)
Kevin Wright
Thanks for your reply, Kevin. Yes, you second suggestion is a more natural representation of the working hours -- a day starts from the morning instead of the mid-night (for most people). For the histogram, actually I'm not a regular user of ggplot2, and I didn't check stat_bin() carefully, but after your reminding, I found a weird behavior of it which confused me: qplot(1:10)+stat_bin(binwidth=1) will produce a histogram which is not flat... :shock:
Originally posted on 2009-10-28 02:26:24
Guest *Thomas Levine* @ 2010-06-17 00:20:02 originally posted:
I think Ripley's high commit count is misleading when you're comparing whether he sleeps to whether other R core members sleep. You should change the y axes from raw count to percentage of total count. Once you do this, I think the other authors' commits will look more spread-out.
Thanks! That will be a reasonable enhancement :)
Originally posted on 2010-07-02 11:07:49
Sign in to join the discussion
Sign in with GitHub