<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Statistics, R, Graphics and Fun &#187; ggplot2</title>
	<atom:link href="http://yihui.name/en/tag/ggplot2/feed/" rel="self" type="application/rss+xml" />
	<link>http://yihui.name/en</link>
	<description>Yihui XIE</description>
	<lastBuildDate>Fri, 23 Jul 2010 16:33:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>50000 Revisions Committed to R</title>
		<link>http://yihui.name/en/2009/10/50000-revisions-committed-to-r/</link>
		<comments>http://yihui.name/en/2009/10/50000-revisions-committed-to-r/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 06:04:17 +0000</pubDate>
		<dc:creator>Yihui Xie</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[R Graphics]]></category>
		<category><![CDATA[R Language]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Brian Ripley]]></category>
		<category><![CDATA[ggplot2]]></category>
		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://yihui.name/en/?p=304</guid>
		<description><![CDATA[oday Romain Francois posted an interesting topic in the R-help list, and you can read his blog post for more details: celebrating R commit #50000. 50000 is certainly not a small number; we do owe R core members a big &#8220;thank you&#8221; for their great efforts in this fantastic statistical language in the 13 years. [...]]]></description>
			<content:encoded><![CDATA[<a href="http://yihui.name/en/2009/10/50000-revisions-committed-to-r/"><span class="dropcap-none">T</span></a>oday <a rel="nofollow" href="http://romainfrancois.blog.free.fr/">Romain Francois</a> posted an interesting topic in the R-help list, and you can read his blog post for more details: <a title="celebrating R commit #50000" href="http://romainfrancois.blog.free.fr/index.php?post/2009/10/09/celebrating-R-commit-50000">celebrating R commit #50000</a>. 50000 is certainly not a small number; we do owe R core members a big &#8220;thank you&#8221; for their great efforts in this fantastic statistical language in the 13 years. When I saw Romain&#8217;s data, I suddenly remembered a question I asked to one of Prof Ripley&#8217;s student a couple of years ago: <em>does Prof Ripley ever sleep?</em> And he answered &#8220;No!&#8221;. No wonder we can see Prof Ripley so frequently in the R-help/devel mailing list. If you have stayed on R-help list for enough long time, you&#8217;ll surely know several facts, e.g. Martin Maechler will arrive in less than 3 minutes if you dare call an R package &#8220;library&#8221;, and you will get &#8220;Ripleyed&#8221; if you are not careful enough in posting your R code.</p>
<pre>&gt; library(fortunes)
&gt; fortune("Ripleyed")

And the fear of getting Ripleyed on the mailing list also makes me think, read,
and improve before submitting half baked questions to the list.
 -- Eric Kort
 R-help (January 2006)</pre>
<p><span id="more-304"></span>While these facts are revealing their great efforts in helping R users, we can see their work hours in committing revisions to R. For example, the answer to my question is clear in the graph below:</p>
<p><div id="attachment_306" class="wp-caption aligncenter" style="width: 490px"><a href="http://yihui.name/en/wp-content/uploads/2009/10/ripley-work-hour.png"><img class="size-full wp-image-306 " title="Prof Ripley Never Sleeps" src="http://yihui.name/en/wp-content/uploads/2009/10/ripley-work-hour.png" alt="Does Prof Ripley Ever Sleep?" width="480" height="480" /></a><p class="wp-caption-text">Prof Ripley Never Sleeps</p></div>
<pre>## R code borrowed from Romain Francios
process_chunk &lt;- function(txt) {
    if (length(txt) == 1L)
        return(NULL)
    header_line &lt;- strsplit(txt[2L], " | ", fixed = TRUE)[[1]][c(1L,
        2L, 3L)]
    revision &lt;- substring(header_line[1], 2)
    author &lt;- header_line[2]
    if (author %in% c("apache", "root"))
        return(NULL)
    date &lt;- substring(header_line[3], 1, 25)
    nlines &lt;- length(date)
    matrix(c(rep.int(revision, nlines), rep.int(author, nlines),
        rep.int(date, nlines)), nrow = nlines)
}
data &lt;- local({
    lines &lt;- readLines("rsvn.log")
    index &lt;- cumsum(grepl("^-+$", lines))
    commits &lt;- split(lines, index)
    do.call(rbind, lapply(commits, process_chunk))
})
colnames(data) &lt;- c("revision", "author", "date")
simple &lt;- data[!duplicated(data[, "revision"]), ]
hour.data = data.frame(author = simple[, "author"],
      hour = as.integer(substr(simple[, "date"], 12, 13)), year = as.integer(substr(simple[,
          "date"], 1, 4)))
hour.data = subset(hour.data, year &gt;= 1997 &amp; (author %in%
    c("hornik", "maechler", "pd", "ripley")))
library(ggplot2)
# png("ripley-work-hour.png")
qplot(hour, data = subset(hour.data, author == "ripley"),
    main = "Does Prof Ripley Ever Sleep?") + stat_bin(binwidth = 1)
# dev.off()</pre>
<p>Here I only selected four authors who have largest number of commits during 1997~2009. We can see the changes of working hours along these years:</p>
<div id="attachment_310" class="wp-caption aligncenter" style="width: 490px"><a href="http://yihui.name/en/wp-content/uploads/2009/10/r-core-work-hour.gif"><img class="size-full wp-image-310" title="Working hours of four R core members" src="http://yihui.name/en/wp-content/uploads/2009/10/r-core-work-hour.gif" alt="Working hours of four R core members" width="480" height="480" /></a><p class="wp-caption-text">Working hours of four R core members</p></div>
<pre>hour.max = max(with(hour.data, table(author, year,
    hour)))
library(animation)
# you need ImageMagick to create the GIF animation!
saveMovie({
for (i in sort(unique(hour.data$year))) {
    print(qplot(hour, data = subset(hour.data, year == i), xlim = c(0,
        23), ylim = c(0, hour.max), main = i) + facet_wrap(~author) +
        stat_bin(binwidth = 1))
}
}, interval = 1.5, moviename = "r-core-work-hour", outdir = getwd())</pre>
<p>The patterns are clear: Kurt does not like burning night oil; Martin tends to work very early in the morning (esp during 2000~2004); Peter always work at mid-night (highly centered around 12pm); and for Prof Ripley, he works round the clock but most in the morning (probably that&#8217;s when he begins to &#8220;Ripley&#8221; users? after that time, less people dare to report bugs so his work decays exponentially?)</p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://yihui.name/en/2007/12/make-optical-illusions-in-r-graphics-system/" title="Make Optical Illusions in R Graphics System">Make Optical Illusions in R Graphics System</a></li><li><a href="http://yihui.name/en/2007/10/animations-in-survey-sampling/" title="Animations in Survey Sampling">Animations in Survey Sampling</a></li><li><a href="http://yihui.name/en/2010/03/a-demo-for-the-ratio-estimation/" title="A Demo for the Ratio Estimation in Sampling Survey (Animation)">A Demo for the Ratio Estimation in Sampling Survey (Animation)</a></li><li><a href="http://yihui.name/en/2009/12/happy-new-year-with-r/" title="Happy New Year with R">Happy New Year with R</a></li><li><a href="http://yihui.name/en/2009/12/merry-christmas-using-r/" title="Merry Christmas Using R">Merry Christmas Using R</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://yihui.name/en/2009/10/50000-revisions-committed-to-r/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
