RODBC helper function

The number of times I have to connect to SQL and I forget part of the RODBC command to connect to an internal data table. As part of a project I am working on I have been connecting to lots of different sources and became tired of typing lots of lines and repeating the same…

Continue Reading

NHS-R Community: Up the R-evolution

It seems like two seconds ago since I was frantically preparing slides for the first NHS community. Wow – what an experience and kudos to the team @NHS-R Community for arranging it. The full content of the event has been posted: https://nhsrcommunity.com/nhs-r-conference-9-october-2018/. What a fantastic event this was and I met many of my fellow…

Continue Reading

DPLYR: A Beginners Guide

What is DPLYR? Dplyr is a grammar of data manipulation, providing a consistent set of verbs that help you solve the most common data manipulation challenges. The next series of examples will show how you can use the shortcuts in Dplyr to achieve the results of traditional R data manipulation, but faster. Setting dplyr up…

Continue Reading

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, to show the distribution shape of the data. The thick black bar in the centre represents the interquartile range, the thin black line extended from it represents the 95% confidence intervals, and the white dot is the…

Continue Reading

Box Plots in ggplot2

Setting up the plot The box plot, in ggplot2, can be really powerful and useful for analysing variation. I will show a few examples of different types of box plots in ggplot2. Basic Box Plot 1 2 3 4 5 6 7 8 9 10 library(ggplot2) theme_set(theme_classic()) # Plot plot <- ggplot(mpg, aes(class, cty)) plot…

Continue Reading