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

Creating a coverage plot using BEDTools and R

One of my Top 10 posts is on creating a coverage plot using R. For that post I used CAGE data, which is a transcriptomic data set containing transcription start sites, and I used R exclusively for building a “coverage plot.” The main issue with that post was that the plots were density plots rather…

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