Promoting the use of R in the NHS

R tips

Dygraphs

Dygraphs for mortality surveillance I recently presented some of the mortality surveillance charts we use to @RLadiesLondon (a very welcoming group!) and […]

Count of working days function

It’s at this time of year I need to renew my season ticket and I usually get one for the […]

rforhealthcare.org – A free online resource for all your R related healthcare needs

Down in the South West of England we at the PenCHORD team of the NIHR CLAHRC South West Peninsula have […]

Format ONS spreadsheet

Background A Public Health consultant colleague Ian Bowns (@IantheBee) created a report to monitor mortality within the Trust and he […]

Using R to track NHS winter pressures

Every Thursday during winter, roughly from December to March, NHS Digital releases a week’s worth of hospital performance data, known as […]

Animating a Graph Over Time in Shiny

                        I was interested in creating an animated graph […]

A run chart is not a run chart is not a run chart

Understanding variation using runs analysis Run charts are simple and powerful tools that help discriminate between random and non-random variation […]

A simple function to create nice correlation plots

The problem I was working with a dataset where I wanted to assess the correlation of different variables in R. […]

From script-based development to function-based development and onwards to Package Based development: part 2

At the NHS R Conference, I suggested to people that they should embrace the idea of package-based development rather than […]

Roadmap to collaborative working using R in the NHS: Part I- Workflows

We finally have a tool that is data independent. R allows the scripting of a data science methodology that we […]

From script-based development to function-based development and onwards to Package Based development

At the NHS R Conference, I suggested to people that they should embrace the idea of package-based development rather than […]

Installing R and R studio

Installation Instructions (Part 1 of 2) Windows Users To Install R: Open an internet browser and go to r-project.org. Click the […]

A simple function to install and load packages in R

I was starting to despair at the amount of packages I end up using during the task of transforming, cleaning, […]

How to extrapolate data from data

There are many occasions when a column of data needs to be created from an already existing column for ease […]

Even Simpler SQL

I’ve had some feedback on the last post, and rather than repeat the same thing multiple times, I’m going all @drob, […]

Keep data tidy: A plea to data publishers and developers

knitr::opts_chunk$set(echo = TRUE, message = FALSE, cache = TRUE, warning = FALSE) if(!require("pacman")) install.packages("pacman") library(pacman) p_load(readxl, tidyverse, corrplot, tmap, geojsonio, […]

simpler SQL with dplyr

comparing dplyr with SQL nested queries Following on from my last post, where I demonstrated R to some first time […]

Violin and density plots in ggplot2

Violin Plots This chart is a combination of a Box Plot and a Density Plo that is rotated and placed on each side, […]

Pareto Chart in ggplot2

Background of Pareto Charts A Pareto chart, named after Vilfredo Pareto, is a type of chart that contains both bars and a line graph, where individual […]

Histogram with auto binning in ggplot2

Histograms (with auto binning) Again, we will use the mtcars dataset and use the fields in that to produce the […]

Diverging Dot Plot and Lollipop Charts – Plotting Variance with ggplot2

Creating the Dot Plot Variance chart The data preparation was used in the previous blog entitled: Diverging Bar Charts – Plotting […]

Diverging Bar Charts – Plotting Variance with ggplot2

Diverging Bar Charts The aim here is to create a diverging bar chart that shows variance above and below an […]

R studio shortcuts

I love keyboard shortcuts. I work in R studio and using keyboard shortcuts has saved me a lot of time. […]

The :: operator

Namespace issues Most of the functionality in R comes from additional packages that you load. Sometimes two packages will have […]