Importing vector images into R

The grImport package can be used to import vector images into R so that you can edit and/or combine it other plots. In this post, I will go through the grImport workflow and finally show how vector images can be incorporated with other graphical objects.

Continue Reading

Visualising Google Trends results with R

I haven’t been blogging as much as I’d like to due to other commitments but I wanted to write a post before 2018 ends. This post is on plotting Google Trends results with R. If you’ve never heard of or used Google Trends, it’s fun! You can see how certain keywords have trended over the…

Continue Reading

Interactive plots in R

Interactive plots, as the name suggests, are plots that users can interact with. In my last post, I mentioned that for interactive heatmaps I use the d3heatmap package. To get started with this post, I’ll create the same heatmap as my last post but this time using the d3heatmap package.

Continue Reading

Making a heatmap in R with the pheatmap package

For a while, heatmap.2() from the gplots package was my function of choice for creating heatmaps in R. Then I discovered the superheat package, which attracted me because of the side plots. However, shortly afterwards I discovered pheatmap and I have been mainly using it for all my heatmaps (except when I need to interact…

Continue Reading

Creating a flowchart using R

The diagram package makes it easy to create flowcharts in R. In this post I’ll show an example of creating a simple flowchart. The most important part is to understand how the coordinate systems works; once you understand that, it’s just a matter of placing your arrows and boxes accordingly to create your flowchart. To…

Continue Reading

Matrix to adjacency list in R

An adjacency list is simply an unordered list that describes connections between vertices. It’s a commonly used input format for graphs. In this post, I use the melt() function from the reshape2 package to create an adjacency list from a correlation matrix. I use the geneData dataset, which consists of real but anonymised microarray expression…

Continue Reading

Making a heatmap in R with the superheat package

I discovered the superheat package a few days ago and the adjacent plots feature was really attractive. The superheat #rstats package for making heatmaps looks super! I like the adjacent plots https://t.co/KhyA6K6Ap3 — Dave Tang (@davetang31) February 3, 2017

Continue Reading

Interactive plots in R using plotly

I found out about plotly a couple of months ago via R-bloggers: Gantt charts in R using Plotly via @Rbloggers #rstats https://t.co/LuW8nuQr6c — Dave Tang (@davetang31) May 13, 2016 I finally gave it a go when a friend asked me for help making a Gantt chart and I was impressed with plotly’s interactivity and ease…

Continue Reading

Wordcloud of PubMed searches

At the start of this year I created a Twitter account that automatically tweets out papers related to transcriptomes, i.e. a Twitter literature bot. This idea isn’t new and there are over 200 Twitter literature bots. However, I wrote my Twitter bot using R (and using the RISmed package to search PubMed for papers) and…

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