Blog Archives

Beautiful boxplots in base R

April 28, 2017
By
Beautiful boxplots in base R

As many of you will be aware, I like to post some R code, and I especially like to post base R versions of ggplot2 things! Well these amazing boxplots turned up on github – go and check them out! So I did my own version in base R – check out the code here and

Read more »

Reading data from google sheets into R

November 22, 2016
By
Reading data from google sheets into R

Reading data from google sheets into R is something you imagine should be really simple, but often is anything but. However, package googlesheets goes a long way to solving this problem. Let’s crack on with an example. First, install the software: install.packages("googlesheets") We then need an example sheet to work with, and I’m going to

Read more »

Creating an image of a matrix in R using image()

October 6, 2016
By
Creating an image of a matrix in R using image()

You have a matrix in R, and you want to visualise it – say, for example, with each cell coloured according to the value in the cell.  Not a heatmap, per se, as that requires clustering; just a simple, visual image. Well, the answer is image() – however, there is the slightly bizarre coding choice

Read more »

How to produce an animated gif of rise in global temperature in R

September 15, 2016
By
How to produce an animated gif of rise in global temperature in R

I came across a really cool tweet a few days ago containing an animated GIF demonstrating rise in global temperatures since 1880: Visualizing the Warmest August in 136 Years https://t.co/PSjA2NfYem Data via @NASAGISS #NASA #climate pic.twitter.com/DIk8z7Zodj — NASA Earth (@NASAEarth) September 12, 2016 Link to the blog is here. I wanted to see if I

Read more »

Plotting cool graphs in R

August 25, 2016
By
Plotting cool graphs in R

I have to admit to being a bit of a snob when it comes to graphs and charts in scientific papers and presentations.  It’s not like I think I am particularly good at it – I’m OK – it’s just that I know what’s bad.  I’ve seen folk screenshot multiple Excel graphs so they can

Read more »

I can’t recreate a graph from Ioannidis et al – can you?

July 8, 2016
By
I can’t recreate a graph from Ioannidis et al – can you?

Very quick one this!  Really interesting paper from Ioannidis et al about citation indices. I wanted to recreate figure 1, which is: Closest I could get (code here) is this: Biggest difference is in NS, where they find all negative correlations, but most of mine are positive. Source data are Table S1 Data. Am I doing something wrong?

Read more »

Plot your own EU referendum poll results

June 22, 2016
By
Plot your own EU referendum poll results

Due to the unspeakable horror of the EU referendum, I have to find something to make me feel better.  This poll of polls usually does so, though it is way too close for comfort. Anyway, I took their data and plotted it for myself.  Data and script are on github, and all you need is R.

Read more »

Your strongly correlated data is probably nonsense

April 27, 2016
By

Use of the Pearson correlation co-efficient is common in genomics and bioinformatics, which is OK as it goes (I have used it extensively myself), but it has some major drawbacks – the major one being that Pearson can produce large coefficients in the presence of very large measurements. This is best shown via example in

Read more »

Generate a single contig, hybrid assembly of E coli using MiSeq and MinION data

December 16, 2015
By
Generate a single contig, hybrid assembly of E coli using MiSeq and MinION data

If you have MiSeq and ONT MinION data, it is now very easy to combine them into a single-contig, high quality assembly.  Here I will start with a base Ubuntu 14.04 LTS distribution and take you through every step, including software installation.  I am starting with an Amazon EC2 m4.xlarge AMI with 4 vCPUs and

Read more »

How to extract FASTQ from the new MinION FAST5 format using poRe

November 23, 2015
By

A little while ago I demonstrated how to extract FASTQ from MinION FAST5 files using Rscript and the Linux command line. In that article, I described how to extract the different FASTQ data using a parameter: # 2D is the default invisible(apply(array(f5files), 1, printfastq)) # template invisible(apply(array(f5files), 1, printfastq, f5path="/Analyses/Basecall_2D_000/BaseCalled_template")) # complement invisible(apply(array(f5files), 1, printfastq, f5path="/Analyses/Basecall_2D_000/BaseCalled_complement"))

Read more »

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)