The NHS-R community aims to support the learning, application and exploitation of R in the NHS.
The NHS-R community is welcoming and enthusiastic about R and if you are new to R you will find friendly support and encouragement. Please see below some ways to get started!
- Install R.
- Choose your version of R and download it from here: https://www.r-project.org/
- Run the installer with default settings
- Install RStudio.
- Choose a correct version of RStudio for your OS and download free desktop version of here: https://www.rstudio.com/products/rstudio/download/
- You might not have admin rights on your laptop. If you are unable to install R and RStudio, please contact your IT team.
Please consider joining an ‘Introduction to R and RStudio’ workshop.
These are run every month (2nd Wednesday). Please see Events for further information and how to book.
A recording of this session is available on YouTube.
Further workshop information is available here: https://philosopher-analyst.netlify.app/collection/
- View our YouTube Gallery – https://momsite.co.uk/resources/youtube-gallery/
Here you will find links to our webinars, conference talks and workshops – on a wide range of R related topics.
- NHS-R Webinars
NHS-R host a monthly webinar covering a variety of topics, please see Webinars for a list of upcoming sessions. Webinars are recorded and are available to view via our YouTube Gallery.
Like learning any language, practice is key. If you are looking for data to practice your R skills on, ONS or NHS Digital have several open data sets that provide a good starting point for getting to grips with data wrangling using the dplyr package and creating graphs with the ggplot2 package.
You might also want to check NHSRdatasets package. Funded and created by the NHS-R Community, this package brings together various healthcare data including HES-based synthetic dataset and ONS provisionally recorded weekly deaths.
Packages to start with
Starting coding in R might seem overwhelming – there are too many packages out there. Below is the list of the must-have packages for different needs:
- Working with the data:
Wrangling data – Tidyverse (collection of R packages including dplyr)
Working with dates – lubridate
- Data visualisations:
To create a chart – ggplot2
For interactive visualisations – plotly
For animated charts – gganimate
For stunning maps – leaflet
- Statistical Modelling:
Pre-loaded package “base” has a number of statistical functions already, such as various statistical tests and linear regression modelling.
For forecasting – forecast, astsa
For clustering – cluster, pvclust
- Automated reports:
To create automated reports in doc, pdf or html format – RMarkdown
Sharing your code might be beneficial for debugging as well as for helping other R users around the world. GitHub is a Git repository hosting service which was created to enable collaborative coding and sharing ofcode. You can find out more about GitHub here – https://github.com/about
View the NHS-R Webinar by Zoë Turner who provides an overview of GitHub https://www.youtube.com/watch?v=SGD3nK7u8fw
NHS-R Github: https://github.com/nhs-r-community
It might be tricky to remember all the functions in all the packages. Please have a look at variety of cheatsheets online – https://www.rstudio.com/resources/cheatsheets/
Visit the website: “R for Data Science”. Hadley Wickham and Garrett Grolemund
This online book will teach you how to do data science with R
“Data science is an exciting discipline that allows you to turn raw data into understanding, insight, and knowledge. The goal of “R for Data Science” is to help you learn the most important tools in R that will allow you to do data science. After reading this book, you’ll have the tools to tackle a wide variety of data science challenges, using the best parts of R.”
- Read how others have started with R, for tips and inspiration.
- Further learning:
From Forecasting to Funnel plots, the NHS-R community shares its experience and learning.
View NHS- R Blogs LINK
Continued learning, please see the following resources:
Still have questions? Join the NHS-R Community on Slack
For conversations about R and other data science/analysis tools and for help with queries and technical advice our Slack Channel is a great place for connecting with our active community who have a wealth of knowledge.