I don't know if you have read it or not, but I briefly discussed my R coding endeavors in my last Sci Comm blog post. R, in the words of its developers at The R Foundation, is a [free!] "language and environment for statistical computing and graphics". People in the Perry lab utilize R to make sense of our genomic data, run simulations of our findings to test significance, and, most important of all, to make lovely figures. Those of us that write in R a lot also tend to run it in RStudio because it just makes everything easier.
One of the first thing members do when they join/visit the Perry lab with absolutely no coding experience (i.e., me three years ago) is learn how to code in R. Step one on our endeavor is Code School's free course called Try R, because it's a great starter set up that also happens to be pirate themed.
While everyone's step two is a bit more customizable, it typically involves being given a task by someone in the lab that you have to complete with R. PJ and I had the idea of turning the code that I wrote for my second first-author publication into a little R practice project. The tasks I performed for our paper An evolutionary medicine perspective on Neandertal extinction were all completed in R with pre-existing datasets. Every time I had a marginal bit of success I would save a new "master" file with everything I had accomplished saved in additional columns of what ended up being a massive table. Thus it seemed a natural extension to turn this bit of code into a tutorial:
DISCLAIMER: I am not an R wizard - some of my code is not that "pretty", most of it is rather inefficient, and there are about a hundred ways to achieve the same results as someone else in R, but that's sort of the point of this whole exercise anyway.
Most of the coding effort that went into the Neandertal paper was focused on combining those pre-existing datasets I mentioned and finding certain things within those datasets. I've been splitting each of the steps I accomplished into "tasks" that I've been sharing with a few members of the Perry lab who wished to sharpen their R skills (see left). I've attempted to keep descriptions for each task detailed yet vague - a bit of struggle is good for learning how to write code :) |
We've been using a shared Dropbox folder to assign each task and disperse all necessary files, and after a couple of days we meet to discuss outcomes. We chat about how each of them completed the task, and then about how I had originally worked through it. I think every single meeting we've come up with different ways for achieving the same result, but like I mention earlier in my disclaimer, that's what this whole tutorial was about. |
We've recently had a few deadlines creep up, so we've shifted our priorities accordingly and have reserved the last two tasks for next week. I'd be happy to post this tutorial here if people R interested (hehe). I wish you happy coding, whether it be in R or any other language! Cheers :)