Using dplyr to aggregate in R

I recently completed Data Manipulation in R with dplyr and realised that dplyr can be used to aggregate and summarise data the same way that aggregate() does. I wrote a post on using the aggregate() function in R back in 2013 and in this post I’ll contrast between dplyr and aggregate().

Continue Reading

6th anniversary

It has been a quiet year of blogging since my 5th anniversary; there has only been 13 posts since. Though as I have mentioned before, I am using GitHub to share tutorials and some of my work. However, I will try to write at least twice a month, especially now that I have decided to…

Continue Reading

Learning R through a mini game part 3

This is my third post on learning R through the BetaBit package, which contains three mini games for learning R. I wrote about the first game, called proton, late last year and the second game, called frequon, a week and a half ago. The third game is called regression and it’s much more statistical than…

Continue Reading

Learning R through a mini game part 2

Late last year I discovered proton, an educational game in R about processing data frames, via R-bloggers and had a go at it. I thought it was fun and educational; it was also the first time I tried to use the dplyr package. I recently learned that there are two more games produced by the…

Continue Reading

Learning R through a mini game

Just last night I found this educational mini game written in R and decided to have a go at it: This was a fairly fun #Rstats game: https://t.co/0zGCQqCxvw (Only after brute-forcing it, I realised I didn't have to.) — Dave Tang (@davetang31) December 5, 2015 I completed it but as I alluded to in my…

Continue Reading

Miscellaneous plots in R

The R Graphics Cookbook is an awesome book; it’s so awesome that I bought the ebook after I bought the hardcopy because one copy of it wasn’t enough. I haven’t read the book in its entirety yet, but I thought I’ll share with you some of the recipes in Chapter 13, which illustrates how to…

Continue Reading

Animated plots using R

I learned the simple concept of animation back in school, when some of my classmates would draw stick figures on the edge of large textbooks. At first I was wondering why one would defile a textbook in such a way, but then as they flipped through the pages and brought the stick figures to life,…

Continue Reading

BED to GRanges

Updated 2015 April 6th to include the intersect_bed() function in the bedr package. Last year I saw a post on Writing an R package from scratch and I always wanted to follow the tutorial. Yesterday while trying to make some plots using Gviz, I had some BED-like files (not supported by Gviz), which I wanted…

Continue Reading

Quantile normalisation in R

Updated 2015 January 14th to include a slide from Rafael. From Wikipedia: In statistics, quantile normalization is a technique for making two distributions identical in statistical properties. To quantile normalize two or more distributions to each other, without a reference distribution, sort as before, then set to the average (usually, arithmetical mean) of the distributions….

Continue Reading