<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/where-have-you-been-getting-my-github-activity/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.masalmon.eu/2017/12/21/wherehaveyoubeen/"> Maëlle</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>On my pretty and up-to-date CV, one of the first things one sees is my Github username, linking to my <a rel="nofollow" href="https://github.com/maelle/" target="_blank">Github profile</a>. What does a potential employer look at there? <em>Hopefully not my non informative commit messages…</em> My imitating a red <a rel="nofollow" href="https://en.wikipedia.org/wiki/Ampelm%C3%A4nnchen" target="_blank">Ampelmann</a>, my being part of several organizations, my pinned repositories described with emojis… But how would they know <em>where&amp;how</em> I’ve mostly been active without too much effort?</p>
<p>A considerable part of my Github work happens in organizations: I’m a co-editor at <a rel="nofollow" href="https://github.com/ropensci/onboarding" target="_blank">rOpenSci onboarding of packages</a>, I contribute content to the <a rel="nofollow" href="https://github.com/rweekly/rweekly.org/" target="_blank">R Weekly newsletter</a>, etc. Although my profile shows the organizations I belong to, one would need to dig into them for a while before seeing how much or how little I’ve done. Which is fine most of the time but less so when trying to profile myself for jobs, right? Let’s try and fetch some Github data to create a custom profile.</p>
<p><em>Note: yep I’m looking for a job and ResearchGate’s suggestions are not helpful! Do you need an enthusiastic remote data scientist or research software engineer for your team? I’m available up to 24 hours a week! I care a lot about science, health, open source and community. Ideally I’d like to keep working in something close to public research but we can talk!</em></p>
<p><span></span></p>
<h1>Getting all my activity</h1>
<p>Note: for another look at Github activity, more related to when people work, check out <a rel="nofollow" href="https://daattali.com/shiny/visualize-git-commits-time/" target="_blank">Dean Attali’s cool Shiny app</a>!</p>
<p>I’m a big fan of the simplistic <a rel="nofollow" href="https://github.com/r-lib/gh" target="_blank"><code>gh</code> package</a> that I’ve used in my <a rel="nofollow" href="http://www.masalmon.eu/2017/02/21/firstcommit/" target="_blank">blog post about initial/first commits</a> and in my <a rel="nofollow" href="http://www.masalmon.eu/2017/04/12/seeds/" target="_blank">blog post about random seeds</a>. My workflow is reading the <a rel="nofollow" href="https://developer.github.com/v3/" target="_blank">API documentation</a> to find which endpoints I need to answer my question, then writing code that loops/maps over pages of answers from the API and unnests results, all of this inspired by the package README and now my own old posts. If I used this data more often, I imagine I’d need less copy-pasting from my previous uses, but in this situation I’m very happy that my past self published this stuff. I’m also thankful I set a <code>GITHUB_PAT</code> environment variable as explained <a rel="nofollow" href="http://happygitwithr.com/api-tokens.html" target="_blank">here</a>.</p>
<p>The problem with the <code>/users/:username/events/public</code> endpoint of Github API is that it only provides you with the 300 latest events from an user, which is not enough, so I had to branch out and look at another source of data, <a rel="nofollow" href="https://www.githubarchive.org/" target="_blank">Github archive</a> via <a rel="nofollow" href="https://developers.google.com/bigquery/" target="_blank">Google BigQuery</a>. I had never touched it and will let Google’s own words define it: “BigQuery is Google’s fully managed, petabyte scale, low cost analytics data warehouse.”. To interact with this tool, there are at least two R packages, <a rel="nofollow" href="http://code.markedmondson.me/bigQueryR/" target="_blank"><code>bigQueryR</code></a> and <a rel="nofollow" href="https://github.com/r-dbi/bigrquery" target="_blank"><code>bigrquery</code></a>. I chose the latter after reading the short comparison from the website of the former. I created a project as explained <a rel="nofollow" href="https://github.com/r-dbi/bigrquery#sample-data-and-a-billing-project" target="_blank">here</a>.</p>
<p>After that, here is the code I ran. I mostly adapted the example from Github archive page to:</p>
<ul>
<li>
<p>ask for all my events in the last two years but not at once because of my quota for query bytes;</p>
</li>
<li>
<p>ask for <em>my</em> events either with my current username “maelle” or the one I had before that, “masalmon” (by the way I’m so happy I could claim “maelle” because that user was not active! I love having people use my first name to ping me!);</p>
</li>
<li>
<p>get all the events, not only issues opened, and their creation date.</p>
</li>
</ul>
<p>It took me less time as expected to get it, I was helped by my familiarity with Github data and with SQL queries, or my capacity to <a rel="nofollow" href="http://www.masalmon.eu/2017/08/06/p1/" target="_blank">update existing queries to serve my needs</a>, ahahah.</p>
<p>I started out using the basic free tier, but it turned out I was reaching the quota by query all the time, so it was not going to work. I tried changing my query but finally took the plunge and used the free <em>trial</em>. You get 300$, and one TB of query costs 5$. One day queried by the code below is equivalent to something in the magnitude of 10 gigabytes processed, so I was going to be fine (see the <a rel="nofollow" href="https://cloud.google.com/bigquery/pricing" target="_blank">pricing information</a>).</p>
<div>
<div>
<pre><code><span># using the very handy anytime package!</span><span>
</span><span>dates</span><span> </span><span>&lt;-</span><span> </span><span>seq</span><span>(</span><span>from</span><span> </span><span>=</span><span> </span><span>anytime</span><span>::</span><span>anydate</span><span>(</span><span>&quot;2015-12-20&quot;</span><span>),</span><span>
</span><span>to</span><span> </span><span>=</span><span> </span><span>anytime</span><span>::</span><span>anydate</span><span>(</span><span>&quot;2017-12-19&quot;</span><span>),</span><span>
</span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;1 day&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;bigrquery&quot;</span><span>)</span><span>
</span><span>get_one_day_events</span><span> </span><span>&lt;-</span><span> </span><span>function</span><span>(</span><span>day</span><span>){</span><span>
</span><span>project</span><span> </span><span>&lt;-</span><span> </span><span>#projectid here </span><span>
</span><span>sql</span><span> </span><span>&lt;-</span><span> </span><span>paste0</span><span>(</span><span>&quot;/* count of issues opened, closed, and reopened between 1/1/2015 and 2/1/2015 */
SELECT type, repo.name, actor.login, created_at,
JSON_EXTRACT(payload, '$.action') as event, FROM (TABLE_DATE_RANGE([githubarchive:day.], TIMESTAMP('&quot;</span><span>,</span><span>
</span><span>as.character</span><span>(</span><span>day</span><span>),</span><span>
</span><span>&quot;'), TIMESTAMP('&quot;</span><span>,</span><span>
</span><span>as.character</span><span>(</span><span>day</span><span> </span><span>+</span><span> </span><span>1</span><span>),</span><span> </span><span>&quot;')
)) WHERE (actor.login = 'maelle' OR actor.login = 'masalmon')
;&quot;</span><span>)</span><span>
</span><span>results</span><span> </span><span>&lt;-</span><span> </span><span>try</span><span>(</span><span>query_exec</span><span>(</span><span>sql</span><span>,</span><span> </span><span>project</span><span> </span><span>=</span><span> </span><span>project</span><span>),</span><span> </span><span>silent</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span>
</span><span>if</span><span>(</span><span>is</span><span>(</span><span>results</span><span>,</span><span> </span><span>&quot;try-error&quot;</span><span>)){</span><span>
</span><span>return</span><span>(</span><span>NULL</span><span>)</span><span>
</span><span>}</span><span>else</span><span>{</span><span>
</span><span>return</span><span>(</span><span>results</span><span>)</span><span>
</span><span>}</span><span>
</span><span>}</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>purrr</span><span>::</span><span>map_df</span><span>(</span><span>dates</span><span>,</span><span> </span><span>get_one_day_events</span><span>)</span><span>
</span><span>readr</span><span>::</span><span>write_csv</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>path</span><span> </span><span>=</span><span> </span><span>&quot;data/2017-12-20-my_events.csv&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p>I realized after the fact that I had done overlapping queries, well they overlapped in time so I got many events twice… Stupid me.</p>
<p>Now we just need to wrangle the data a little bit. In particular, we’ll use the <a rel="nofollow" href="https://github.com/Tazinho/snakecase" target="_blank"><code>snakecase</code> package</a> to convert the upper camel case of the type column into something prettier (in my opinion).</p>
<div>
<div>
<pre><code><span># no duplicate</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>unique</span><span>(</span><span>my_events</span><span>)</span><span>
</span><span># Better format for the type</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>stringr</span><span>::</span><span>str_replace</span><span>(</span><span>type</span><span>,</span><span> </span><span>&quot;Event&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>))</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>snakecase</span><span>::</span><span>to_parsed_case</span><span>(</span><span>type</span><span>))</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>stringr</span><span>::</span><span>str_replace_all</span><span>(</span><span>type</span><span>,</span><span> </span><span>&quot;_&quot;</span><span>,</span><span> </span><span>&quot; &quot;</span><span>))</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>tolower</span><span>(</span><span>type</span><span>))</span><span>
</span><span># get repo owner</span><span>
</span><span>my_events</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>owner</span><span> </span><span>=</span><span> </span><span>stringr</span><span>::</span><span>str_replace_all</span><span>(</span><span>repo_name</span><span>,</span><span> </span><span>&quot;/.*&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>))</span><span>
</span><span># save with a fantastic filename... sigh</span><span>
</span><span>readr</span><span>::</span><span>write_csv</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>path</span><span> </span><span>=</span><span> </span><span>&quot;data/2017-12-20-my_events_clean.csv&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p>We got 4991 events from 2015-12-28 09:53:23 to 2017-12-20 06:43:44!</p>
<div>
<div>
<pre><code><span>set.seed</span><span>(</span><span>42</span><span>)</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>(</span><span>dplyr</span><span>::</span><span>sample_n</span><span>(</span><span>my_events</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>10</span><span>))</span><span>
</span></code></pre>
</div>
</div>
<table>
<thead>
<tr>
<th>type</th>
<th>repo_name</th>
<th>actor_login</th>
<th>created_at</th>
<th>event</th>
<th>owner</th>
</tr>
</thead>
<tbody>
<tr>
<td>watch</td>
<td>lindbrook/cholera</td>
<td>maelle</td>
<td>2017-08-11 15:25:04</td>
<td>“started”</td>
<td>lindbrook</td>
</tr>
<tr>
<td>push</td>
<td>maelle/maelle.github.io</td>
<td>maelle</td>
<td>2017-10-04 17:15:57</td>
<td>NA</td>
<td>maelle</td>
</tr>
<tr>
<td>issues</td>
<td>masalmon/monkeylearn</td>
<td>masalmon</td>
<td>2016-05-19 08:34:51</td>
<td>“closed”</td>
<td>masalmon</td>
</tr>
<tr>
<td>issue comment</td>
<td>ropensci/onboarding</td>
<td>maelle</td>
<td>2017-06-19 06:57:32</td>
<td>“created”</td>
<td>ropensci</td>
</tr>
<tr>
<td>issue comment</td>
<td>osmdatar/osmdata</td>
<td>masalmon</td>
<td>2017-02-15 09:09:59</td>
<td>“created”</td>
<td>osmdatar</td>
</tr>
<tr>
<td>issues</td>
<td>ropensci/pdftools</td>
<td>masalmon</td>
<td>2016-11-23 14:59:16</td>
<td>“opened”</td>
<td>ropensci</td>
</tr>
<tr>
<td>issue comment</td>
<td>lockedata/PackageReviewR</td>
<td>maelle</td>
<td>2017-04-20 12:08:29</td>
<td>“created”</td>
<td>lockedata</td>
</tr>
<tr>
<td>issue comment</td>
<td>leeper/colourlovers</td>
<td>masalmon</td>
<td>2016-03-21 16:30:39</td>
<td>“created”</td>
<td>leeper</td>
</tr>
<tr>
<td>issue comment</td>
<td>osmdatar/osmdata</td>
<td>masalmon</td>
<td>2017-02-27 10:42:37</td>
<td>“created”</td>
<td>osmdatar</td>
</tr>
<tr>
<td>push</td>
<td>maelle/eml.tools</td>
<td>maelle</td>
<td>2017-03-23 11:07:45</td>
<td>NA</td>
<td>maelle</td>
</tr>
</tbody>
</table>
<h1>Analysing my activity</h1>
<h2>What kind of events are there?</h2>
<p>Events as defined in this Github data can be for instance</p>
<ul>
<li>
<p>commenting in issues (main job as an rOpenSci editor, ahah),</p>
</li>
<li>
<p>pushing stuff (sadly this count as one event no matter the size of the commit, which is a limitation of this dataset, and I’m not willing to complete it).</p>
</li>
</ul>
<div>
<div>
<pre><code><span>my_events</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>group_by</span><span>(</span><span>type</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>summarize</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>arrange</span><span>(</span><span>-</span><span> </span><span>n</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
</div>
<table>
<thead>
<tr>
<th>type</th>
<th>n</th>
</tr>
</thead>
<tbody>
<tr>
<td>push</td>
<td>1872</td>
</tr>
<tr>
<td>issue comment</td>
<td>1491</td>
</tr>
<tr>
<td>issues</td>
<td>705</td>
</tr>
<tr>
<td>watch</td>
<td>544</td>
</tr>
<tr>
<td>create</td>
<td>151</td>
</tr>
<tr>
<td>pull request</td>
<td>99</td>
</tr>
<tr>
<td>fork</td>
<td>47</td>
</tr>
<tr>
<td>commit comment</td>
<td>34</td>
</tr>
<tr>
<td>release</td>
<td>17</td>
</tr>
<tr>
<td>member</td>
<td>10</td>
</tr>
<tr>
<td>pull request review comment</td>
<td>9</td>
</tr>
<tr>
<td>public</td>
<td>7</td>
</tr>
<tr>
<td>delete</td>
<td>3</td>
</tr>
<tr>
<td>gollum</td>
<td>2</td>
</tr>
</tbody>
</table>
<p>All event types are defined <a rel="nofollow" href="https://developer.github.com/v3/activity/events/types/" target="_blank">here</a>. I had no idea what a <a rel="nofollow" href="https://developer.github.com/v3/activity/events/types/#gollumevent" target="_blank">Gollum event</a> was, but it’s not surprising given I almost never updated or created a Wiki. Member events are the ones corresponding to that highly exciting moment when you’re added (or well, removed, less exciting) as a collaborator to a repository, or when your permissions are changed.</p>
<p>Regarding the difference between issues events and issue comments event, according to the API docs,</p>
<ul>
<li>
<p>an issue event is “Triggered when an issue is assigned, unassigned, labeled, unlabeled, opened, edited, milestoned, demilestoned, closed, or reopened.”(at <a rel="nofollow" href="https://github.com/ropensci/onboarding" target="_blank">rOpenSci onboarding</a>, we use assignments and labelling a lot)</p>
</li>
<li>
<p>while an issue comment event is “Triggered when an issue comment is created, edited, or deleted.”.</p>
</li>
</ul>
<h2>How many events over time?</h2>
<p>Although that’s clearly not my goal here, I was curious to have a look at time series of counts of events! You can’t blame me, time series of counts were the subject of my dissertation, in which I luckily did a bit more than plotting some.</p>
<p>We shall concentrate on most frequent events.</p>
<div>
<div>
<pre><code><span>library</span><span>(</span><span>&quot;ggplot2&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;hrbrthemes&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;lubridate&quot;</span><span>)</span><span>
</span><span>my_events</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>filter</span><span>(</span><span>type</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;push&quot;</span><span>,</span><span> </span><span>&quot;issue comment&quot;</span><span>,</span><span> </span><span>&quot;issues&quot;</span><span>,</span><span> </span><span>&quot;watch&quot;</span><span>,</span><span> </span><span>&quot;create&quot;</span><span>,</span><span> </span><span>&quot;pull request&quot;</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>day</span><span> </span><span>=</span><span> </span><span>as.Date</span><span>(</span><span>created_at</span><span>),</span><span>
</span><span>week</span><span> </span><span>=</span><span> </span><span>update</span><span>(</span><span>day</span><span>,</span><span> </span><span>wday</span><span> </span><span>=</span><span> </span><span>1</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>group_by</span><span>(</span><span>week</span><span>,</span><span> </span><span>type</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>summarise</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_line</span><span>(</span><span>aes</span><span>(</span><span>week</span><span>,</span><span> </span><span>n</span><span>))</span><span> </span><span>+</span><span>
</span><span>facet_grid</span><span>(</span><span>type</span><span> </span><span>~</span><span> </span><span>.</span><span>,</span><span> </span><span>scales</span><span> </span><span>=</span><span> </span><span>&quot;free_y&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme_ipsum</span><span>(</span><span>base_size</span><span> </span><span>=</span><span> </span><span>20</span><span>,</span><span>
</span><span>axis_title_size</span><span> </span><span>=</span><span> </span><span>12</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;none&quot;</span><span>,</span><span>
</span><span>strip.text.y</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>angle</span><span> </span><span>=</span><span> </span><span>0</span><span>))</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;My Github contributions in the two last years&quot;</span><span>,</span><span>
</span><span>subtitle</span><span> </span><span>=</span><span> </span><span>&quot;Data queried from Github archive on Google BigQuery&quot;</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p><img alt="plot of chunk unnamed-chunk-5" src="https://i2.wp.com/www.masalmon.eu/figure/source/2017-12-21-wherehaveyoubeen/unnamed-chunk-5-1.png?w=456" data-recalc-dims="1"></p>
<p>What I notice is:</p>
<ul>
<li>
<p>there’s a decrease in my activity, as seen by issue comments and issues created or closed, since the autumn. In September, we moved and had no internet connection for a while, and then we had a baby, with whom I’m now on maternity leave, so this is not a surprise!</p>
</li>
<li>
<p>the number of pushes seems constant which might be surprising given I do code less in my experience… but my pushes, and of pull requests by the way, contain many contributions to R Weekly, where I might update the draft each time I see something interesting to be shared! Now that I’m a member of the organization, I do not need pull requests for that so the number of pull requests is going down, which might be the reason why they added me to the organization… no need to merge my contributions anymore!</p>
</li>
<li>
<p>Speaking of pull requests, this was something I was intimated by (and I haven’t used branches a lot in my own projects) until <a rel="nofollow" href="https://github.com/jimhester" target="_blank">Jim Hester</a> helped me <a rel="nofollow" href="http://firstpr.me/#maelle" target="_blank">create my first PR</a>.</p>
</li>
<li>
<p>What Github calls watch events are most often starring events in my case.</p>
</li>
</ul>
<h2>A look at the places where I’ve been active</h2>
<p>Let’s look where most of my events took place.</p>
<div>
<div>
<pre><code><span>my_events</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>group_by</span><span>(</span><span>owner</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>summarize</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>arrange</span><span>(</span><span>-</span><span> </span><span>n</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>filter</span><span>(</span><span>n</span><span> </span><span>></span><span> </span><span>40</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
</div>
<table>
<thead>
<tr>
<th>owner</th>
<th>n</th>
</tr>
</thead>
<tbody>
<tr>
<td>masalmon</td>
<td>1663</td>
</tr>
<tr>
<td>ropensci</td>
<td>974</td>
</tr>
<tr>
<td>maelle</td>
<td>421</td>
</tr>
<tr>
<td>ropenscilabs</td>
<td>364</td>
</tr>
<tr>
<td>openaq</td>
<td>135</td>
</tr>
<tr>
<td>osmdatar</td>
<td>135</td>
</tr>
<tr>
<td>rweekly</td>
<td>113</td>
</tr>
<tr>
<td>hrbrmstr</td>
<td>67</td>
</tr>
<tr>
<td>openjournals</td>
<td>46</td>
</tr>
<tr>
<td>cvitolo</td>
<td>44</td>
</tr>
<tr>
<td>rladies</td>
<td>43</td>
</tr>
</tbody>
</table>
<p>My events are scattered among 284 owners and 712 repos (I have starred more than 500 repos). I recognize well my two usernames, rOpenSci organizations ropensci and ropenscilabs, R Weekly, etc. I’m surprised I have many events in OpenAQ organization, I thought my contributions were nearly all in the repo of <a rel="nofollow" href="http://ropensci.github.io/ropenaq/" target="_blank">my R package</a> accessing their data! But thinking of it I did participate in conversations in issues. R-Ladies organization is also not one where I felt I had done that much, because my R-Ladies involvement is much more related to the co-founding and organization of the Barcelona chapter, and these days tweeting for R-Ladies Global. I’m also glad to see <a rel="nofollow" href="https://github.com/hrbrmstr" target="_blank">“hrbrmstr” a.k.a Bob Rudis</a>, in the complete list there were other such owners: people that have fantastic packages <em>and</em> make it a pleasure to open issues, contribute code, etc.</p>
<p>Now I’d like to look at the breakdown of event types by owner of the repo. We’ll change the owner variable a bit to get something more interpretable.</p>
<div>
<div>
<pre><code><span>orgs</span><span> </span><span>&lt;-</span><span> </span><span>dplyr</span><span>::</span><span>mutate</span><span>(</span><span>my_events</span><span>,</span><span>
</span><span>blog</span><span> </span><span>=</span><span> </span><span>repo_name</span><span> </span><span>==</span><span> </span><span>&quot;maelle/maelle.github.io&quot;</span><span>,</span><span>
</span><span>my_code</span><span> </span><span>=</span><span> </span><span>owner</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;maelle&quot;</span><span>,</span><span> </span><span>&quot;masalmon&quot;</span><span>)</span><span> </span><span>&amp;</span><span> </span><span>!</span><span>blog</span><span>,</span><span>
</span><span>ropensci_onboarding</span><span> </span><span>=</span><span> </span><span>repo_name</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;ropensci/onboarding&quot;</span><span>,</span><span> </span><span>&quot;ropensci/onboarding-meta&quot;</span><span>),</span><span>
</span><span>ropensci_misc</span><span> </span><span>=</span><span> </span><span>owner</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;ropensci&quot;</span><span>,</span><span> </span><span>&quot;ropenscilabs&quot;</span><span>)</span><span> </span><span>&amp;</span><span> </span><span>!</span><span>ropensci_onboarding</span><span>,</span><span>
</span><span>rweekly</span><span> </span><span>=</span><span> </span><span>owner</span><span> </span><span>==</span><span> </span><span>&quot;rweekly&quot;</span><span>,</span><span>
</span><span>work_from_others</span><span> </span><span>=</span><span> </span><span>!</span><span>blog</span><span> </span><span>&amp;!</span><span>my_code</span><span> </span><span>&amp;</span><span> </span><span>!</span><span>ropensci_onboarding</span><span> </span><span>&amp;</span><span> </span><span>!</span><span>ropensci_misc</span><span> </span><span>&amp;</span><span> </span><span>!</span><span>rweekly</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>tidyr</span><span>::</span><span>gather</span><span>(</span><span>&quot;organisation&quot;</span><span>,</span><span> </span><span>&quot;value&quot;</span><span>,</span><span> </span><span>blog</span><span>:</span><span>work_from_others</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>filter</span><span>(</span><span>value</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p>Again we filter event types, even removing watch/starring events this time.</p>
<div>
<div>
<pre><code><span>orgs</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>filter</span><span>(</span><span>type</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;push&quot;</span><span>,</span><span> </span><span>&quot;issue comment&quot;</span><span>,</span><span> </span><span>&quot;issues&quot;</span><span>,</span><span> </span><span>&quot;create&quot;</span><span>,</span><span> </span><span>&quot;pull request&quot;</span><span>))</span><span>%>%</span><span>
</span><span>ggplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_bar</span><span>(</span><span>aes</span><span>(</span><span>organisation</span><span>,</span><span> </span><span>fill</span><span> </span><span>=</span><span> </span><span>type</span><span>))</span><span> </span><span>+</span><span>
</span><span>theme_ipsum</span><span>(</span><span>base_size</span><span> </span><span>=</span><span> </span><span>20</span><span>,</span><span>
</span><span>axis_title_size</span><span> </span><span>=</span><span> </span><span>16</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>strip.text.y</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>angle</span><span> </span><span>=</span><span> </span><span>0</span><span>),</span><span>
</span><span>axis.text.x</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>angle</span><span> </span><span>=</span><span> </span><span>90</span><span>,</span><span> </span><span>hjust</span><span> </span><span>=</span><span> </span><span>1</span><span>))</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;My Github contributions in the two last years&quot;</span><span>,</span><span>
</span><span>subtitle</span><span> </span><span>=</span><span> </span><span>&quot;Data queried from Github archive on Google BigQuery&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>viridis</span><span>::</span><span>scale_fill_viridis</span><span>(</span><span>discrete</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p><img alt="plot of chunk unnamed-chunk-8" src="https://i1.wp.com/www.masalmon.eu/figure/source/2017-12-21-wherehaveyoubeen/unnamed-chunk-8-1.png?w=456" data-recalc-dims="1"></p>
<div>
<div>
<pre><code><span>orgs</span><span> </span><span>%>%</span><span>
</span><span>dplyr</span><span>::</span><span>filter</span><span>(</span><span>type</span><span> </span><span>%in%</span><span> </span><span>c</span><span>(</span><span>&quot;push&quot;</span><span>,</span><span> </span><span>&quot;issue comment&quot;</span><span>,</span><span> </span><span>&quot;issues&quot;</span><span>,</span><span> </span><span>&quot;create&quot;</span><span>,</span><span> </span><span>&quot;pull request&quot;</span><span>))</span><span>%>%</span><span>
</span><span>ggplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_bar</span><span>(</span><span>aes</span><span>(</span><span>organisation</span><span>,</span><span> </span><span>fill</span><span> </span><span>=</span><span> </span><span>type</span><span>),</span><span>
</span><span>position</span><span> </span><span>=</span><span> </span><span>&quot;fill&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme_ipsum</span><span>(</span><span>base_size</span><span> </span><span>=</span><span> </span><span>20</span><span>,</span><span>
</span><span>axis_title_size</span><span> </span><span>=</span><span> </span><span>16</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>strip.text.y</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>angle</span><span> </span><span>=</span><span> </span><span>0</span><span>),</span><span>
</span><span>axis.text.x</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>angle</span><span> </span><span>=</span><span> </span><span>90</span><span>,</span><span> </span><span>hjust</span><span> </span><span>=</span><span> </span><span>1</span><span>))</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;My Github contributions in the two last years&quot;</span><span>,</span><span>
</span><span>subtitle</span><span> </span><span>=</span><span> </span><span>&quot;Data queried from Github archive on Google BigQuery&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>viridis</span><span>::</span><span>scale_fill_viridis</span><span>(</span><span>discrete</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<p><img alt="plot of chunk unnamed-chunk-8" src="https://i2.wp.com/www.masalmon.eu/figure/source/2017-12-21-wherehaveyoubeen/unnamed-chunk-8-2.png?w=456" data-recalc-dims="1"></p>
<p>It looks as if blogging were a very small part of my work in my own repos but I think it’s due to the fact that I mostly push all material related to one blog post at once. Interestingly I seem to only create repositories under my own brand, which I think is true in general, although I did end up transferring a few packages to rOpenSci. Then, clearly in rOpenSci onboarding, I seem to have done a lot of issue commenting/labelling, etc. This is no surprise. I have also done that for miscellaneous repositories that do not belong to me: I have contributed a bit of code but have talked a lot. As mentioned earlier, my R Weekly contributions are mostly my committing one new entry each time I read something good.</p>
<h1>What about you, dear readers?</h1>
<p>I think I have only scraped the surface of how one could use Github data to profile themselves (or others, of course). Not to mention all the things one could do with Github archive… See <a rel="nofollow" href="https://www.githubarchive.org/#resources" target="_blank">this list</a> for inspiration; and do not hesitate to add suggestions or links to your work in the comments! Where have <em>you</em> been?</p>
<p>Last but not least, if you’d like to contribute more to R, for instance on Github, you should check out <a rel="nofollow" href="http://cwick.co.nz/talks/collab-code-user17/#/" target="_blank">these slides</a> by Charlotte Wickham, they’re full of great tips!</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.masalmon.eu/2017/12/21/wherehaveyoubeen/"> Maëlle</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/m1TRAbdOcnU" height="1"></a></div>