NHSRdatasets
This is an overview of my contributions to this package.
April 23, 2020
NHSRdatasets package is a package created to help NHS, Public Health and related analysts/data scientists learn to use R. It contains several free datasets, help files explaining their structure, and vignette examples of their use.
Contributing
This was the first time I contributed to a package and whilst I could produce a data set and write out a vignette in RMarkdown, I had barely used any GitHub. As with many things with the NHS-R Community, I had so much help from those in the community, notably from Chris Mainey and Tom Jemmett.
I contributed a dataset of weekly provisionally recorded deaths in England from ONS from 2010 to 2019 and wrote out a vignette of how I did this.
I also blogged about how the mortality data set was created for NHS-R Community blog site.
Evolution of the ons_mortality dataset
Since this has been released The Health Foundation have produced an API R package {monstR} which accesses various datasets from the ONS, including weekly provisionally recorded deaths in England. I have written about how to access this data in a blog and this is particularly useful as the data is more up-to-date and includes Covid deaths recorded from 2020.
My own code for creating the dataset changed too, and the code I used to extract the weekly provisional deaths includes extracting spreadsheet tabs, download a weekly changing url and now includes functions: here.
ONS also release monthly registered deaths which are more granular because the numbers are larger over a month. This isn’t included in The Health Foundation {monstR} package and the code I started is still a work in progress. There have been multiple changes to Local Authority names which need to be cleaned.
Using the mortality data
I’ve used the provisionally registered deaths information for a number of years as part of my trust’s mortality surveillance. I use it in a {dygraphs} chart that a Public Health Consultant colleague ( @IantheBee) coded to show the similarity in patterns of death between the East Midlands and our trust mental and general health deaths. He used dygraphs so that it could have two axes but is also interactive.
I wrote a blog on how to create this chart for the NHS-R Community blogs.