Plotting error bars with R

Updated 2018 May 20th Error bars may show confidence intervals, standard errors, and standard deviations. Each feature conveys a different message and this paper on error bars in experimental biology explains it very nicely. For this post I will demonstrate how to plot error bars that show the standard error (SE) or standard error of…

Merging multiple data frames

When I searched for “merging multiple data frames”, I got this hit as the top result. The post was a bit too terse for me, so here’s my expansion of merging multiple data frames in R.

Making symmetric matrices in R

A quick short post on making symmetric matrices in R, as it could potentially be a nasty gotcha. So in R, there are two functions for accessing the lower and upper triangular part of a matrix, called lower.tri() and upper.tri() respectively. Let me illustrate:

Querying PubMed using R

I’ve seen talks over the years where the speaker shows a bar chart with the number of articles in PubMed that contain a certain keyword and tallied per year. In most of the cases the speaker was trying to illustrate the growing number of articles that contain the keyword. Here I try to do the…

Combinations and permutations in R

Time to get another concept under my belt, combinations and permutations. While I’m at it, I will examine combinations and permutations in R. As you may recall from school, a combination does not take into account the order, whereas a permutation does. Using the example from my favourite website as of late, mathsisfun.com: A fruit…

Double square brackets in R

This deserved its own post because I had some difficulty understanding the double square brackets in R. If we search for “double square brackets in R” we come across this tutorial, which shows us that the double square brackets, i.e. [[]], can be used to directly access columns:

R data visualisation

Once upon a time, I made my graphs using Excel because it was the only software that I was aware of for making graphs. Now one can do amazing things with Excel and produce fairly good looking graphs, but after looking at some examples of R graphs, I wanted to learn a bit more about…

Using the Bioconductor annotation packages

Another post related to this course I’m going through (I can’t link it enough times). I have almost finished with the first day of the course and couldn’t resist writing about this lecture on using the Bioconductor annotation packages. I had not realised that the annotation packages could be queried (pardon my ignorance) in the…

Using aggregate and apply in R

2016 October 13th: I wrote a post on using dplyr to perform the same aggregating functions as in this post; personally I prefer dplyr. I recently came across a course on data analysis and visualisation and now I’m gradually going through each lecture. I just finished following the second lecture and the section “Working with…

Fitting a Michaelis-Menten curve using R

Updated 2017 November 22nd Many biological phenomena follow four different types of relationships that include sigmoid, exponential, linear and Michaelis-Menten (MM) type relationships. The MM model is given by where is the reaction rate of product to substrate , represents the maximum rate achieved by the system, and is the substrate concentration at which the…