Index
- R and R Eco-system resources
- R tips
- Python tips
- NHS R and Python communities of practice
- R and Python online books
R
R is an open-source programming language that is widely used among statisticians and data scientists in the NHS. R has a large number of built-in functions and packages for statistical analysis and data visualisation. Along with tools such as Python1, R can be used to develop so-called reproducible analytical pipelines (RAP).
- The R Project for Statistical Computing https://www.r-project.org/
POSIT
Posit is the Company who developed RStudio IDE among other products, previously called RStudio. All your data products have a home on Posit Connect, Deploy R & Python content easily and securely, automate code execution and deliver insights to stakeholders that need them
- Posit website: https://posit.co/
POSIT learning resources
Learning materials from POSIT about R, Python and Quarto
- Blogs: https://posit.co/blog/
- Cheat sheets: https://posit.co/resources/cheatsheets/
- Videos: https://posit.co/resources/videos/
QUARTO
An Open-source scientific and technical publishing system, available for R, Python and Julia.
- Quarto website: https://quarto.org
Get started with Quarto
- Install Quarto: https://quarto.org/docs/get-started/
Authoring Quarto documents
Quarto tutorial – Authoring: https://quarto.org/docs/get-started/authoring/rstudio.html
Include formatted title blocks at the start of the article: https://quarto.org/docs/authoring/title-blocks.html
Quarto themes: Lumen: https://bootswatch.com/lumen/ Journal: https://bootswatch.com/journal/ Cosmo: https://bootswatch.com/cosmo/ Sandstone: https://bootswatch.com/sandstone/ Spacelab: https://bootswatch.com/spacelab/ Slate:https://bootswatch.com/slate/
Update Quarto documents header date date automatically: https://bookdown.org/yihui/rmarkdown-cookbook/update-date.html
Creating websites using Quarto
A couple of resources on how to build a Quarto website:
Creating it: Creating a Quarto website - YouTube: https://www.youtube.com/watch?v=_bglTCjgcqY
Publishing it to GitHub: Publishing a Quarto website through GitHub pages - YouTube: https://www.youtube.com/watch?v=uimdXPZc40I
Changing a Quarto website’s output directory: https://www.youtube.com/watch?v=ZkcY9YQ3iLY
RStudio
RStudio IDE to run R, developed by RStudio now POSIT
- RStudio IDE: https://posit.co/products/open-source/rstudio/
Python
Python main website
- Python: https://www.python.org/
Python coding topics and data structures
NHS R and Python communities of practise
NHS-R Community
Together we aim to promote the use of R in the NHS: https://nhsrcommunity.com/ Wider NHS-R community pages and resources, includes links to a number of recorded sessions and training, all based on NHS datasets
NHS-R Events
- Conferences
- Upcoming conferences: https://nhsrcommunity.com/events/#event_type-conferences
- Show Past Events: https://nhsrcommunity.com/past-events/
- NHS-R Community Conference 2022: https://nhsrcommunity.com/events/nhs-r-community-conference-2022/
- Group Discussions
- Group Discussions: https://nhsrcommunity.com/events/#event_type-group-discussion
- Group Discussions/workshops
- Webinars
- Workshops
4.1 Upcoming workshops - NHS-R Workshop: Introduction to R and RStudio – 11th May 2023: https://nhsrcommunity.com/events/nhs-r-workshop-introduction-to-r-and-r-studio-11th-may-2023/
- NHS-R Workshop: Forecasting Using R – Advanced Methods – May 2023: https://nhsrcommunity.com/events/nhs-r-workshop-forecasting-using-r-advanced-methods-may-2023/
NHSE-R
Welcome to the NHS England R community documentation site The NHS England R Community is not intended to replace any other R user groups - there’s a fantastic national NHS-R Community and lots of local sharing of R work, we want to use this site to signpost to other resources for those specifically using R within NHS England.
NHS England R Community Future NHS: https://future.nhs.uk/NHSERcommunity
Reproducible Analytical Pipelines (RAP): https://nhsengland.github.io/nhs-r-reporting/tutorials/rap.html
NHSD- RAP Community of Practice
RAP Community of practice: https://nhsdigital.github.io/rap-community-of-practice/
- Basic Python data analysis operations: https://nhsdigital.github.io/rap-community-of-practice/training_resources/python/basic-python-data-analysis-operations/
NHS-Python
Python community to promote the use of Python in the NHS.They organize forums, tutorials and coding sessions:
- The Python Community for Healthcare: https://nhs-pycom.net/
Code editors
Pycharm: https://www.jetbrains.com/pycharm/download/#section=windows
VStudio code: https://code.visualstudio.com/
How To Run Selected Lines In VS Code (Visual Studio Code) – YouTube: https://www.youtube.com/watch?v=VXJChVF28jw
Python tips
Python Beginners Guide: https://wiki.python.org/moin/BeginnersGuide/Programmers
The Python Tutorial: https://docs.python.org/3/tutorial/index.html
The 30 Best Python Libraries and Packages for Beginners: https://www.ubuntupit.com/best-python-libraries-and-packages-for-beginners/
What is os.listdir() in python?: https://www.educative.io/answers/what-is-oslistdir-in-python
Get unique values from a column in Pandas DataFrame – GeeksforGeeks: https://www.geeksforgeeks.org/get-unique-values-from-a-column-in-pandas-dataframe/
Python String format(): https://www.programiz.com/python-programming/methods/string/format
Python - Determine the type of an object? - Stack Overflow: https://stackoverflow.com/questions/2225038/determine-the-type-of-an-object
Get / check the type of an object in Python: type(), isinstance(): https://note.nkmk.me/en/python-type-isinstance/
Create pandas dataframe from lists using zip – GeeksforGeeks: https://www.geeksforgeeks.org/create-pandas-dataframe-from-lists-using-zip/?ref=rp
Unit Testing for Data Scientists. Using Pytest to improve the stability: https://towardsdatascience.com/unit-testing-for-data-scientists-dc5e0cd397fb
The Python Tutorial: https://docs.python.org/3/tutorial/index.html#tutorial-index
R tips
R colors resource: https://r-charts.com/colors/
R colors chart: https://rstudio-pubs-static.s3.amazonaws.com/3486_79191ad32cf74955b4502b8530aad627.html
R chart annotations: https://ggplot2-book.org/annotations.html
R Camcoder package: https://github.com/thebioengineer/camcorder
Camcoder package in CRAN: https://cran.r-project.org/web/packages/camcorder/index.html
Create design process animations: https://cran.r-project.org/web/packages/camcorder/vignettes/camcorder_record.html
HTML widgets – useful for Shiny and Markdown reports: https://www.htmlwidgets.org/
Crosstalk to join some widgets together: https://rstudio.github.io/crosstalk/using.html
R Graph Gallery: https://r-graph-gallery.com/
Interactive maps in R using Leaflet: https://rstudio.github.io/leaflet/
Interactive maps in R using Leaflet: https://rstudio.github.io/leaflet/colors.html
Basic intro to main axis and legend titles: http://www.sthda.com/english/wiki/ggplot2-title-main-axis-and-legend-titles
Setting up the R environment: https://ohdsi.github.io/Hades/rSetup.html
How to do fuzzy matching in R: https://stylizeddata.com/how-to-do-fuzzy-matching-in-r/
How to Recode Factor and Character Variables in R: https://stylizeddata.com/how-to-recode-factor-and-character-variables-in-r/
Designing aesthetic and publication ready tables in R: https://github.com/kcuilla/fourth_down_go_rates
How to Recode Factor and Character Variables in R: https://stylizeddata.com/how-to-recode-factor-and-character-variables-in-r/
Driving a web browser with RSelenium: https://www.computerworld.com/article/2971265/how-to-drive-a-web-browser-with-r-and-rselenium.html
R Tidyverse universe
This section contains set of packages that follow Tidyverse data science principles.
tidyverse
The tidyverse is an opinionated collection of R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures.
The goal of tidyr is to help you create tidy data. Tidy data is data where: 1. Every column is variable. 2. Every row is an observation. 3. Every cell is a single value.
- Tidyverse main website: https://www.tidyverse.org/
Core Tidyverse packages:
- ggplot2: https://ggplot2.tidyverse.org/
- dplyr: https://dplyr.tidyverse.org/
- tidyr: https://tidyr.tidyverse.org/
- readr: https://readr.tidyverse.org/
- purrr: https://purrr.tidyverse.org/
- tibble: https://tibble.tidyverse.org/
- stringr: https://stringr.tidyverse.org/
- forcats: https://forcats.tidyverse.org/
Maps in R using ggplot2 and OSM
An introduction to plotting maps in R using ggplot2 An introduction to plotting maps in R using ggplot2 can be found on this online book: https://ggplot2-book.org/maps.html
OpenStreetMap (OSM) Package details: https://cran.r-project.org/web/packages/osmdata/vignettes/osmdata.html
OpenStreepMap. OSM is a global open access mapping project, which is free and open under the ODbL licence (OpenStreetMap contributors 2017: https://www.openstreetmap.org/#map=6/54.910/-3.432
Online R and Python books
An introduction to R - Alex Douglas, Deon Roos, Francesca Mancini, Ana Couto & David Lusseau: https://intro2r.com/
Welcome to R for Data Science - Hadley Wickham, Garrett Grolemund: https://r4ds.had.co.nz/
Think Python -How to Think Like a Computer Scientist - Alllen B. Downey: https://greenteapress.com/thinkpython2/html/index.html
Ggplot2 Elegant Graphics for Data Analysis - Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen: https://ggplot2-book.org/index.html
Ggplot2 Elegant Graphics for Data Analysis - Specific chapter about plotting maps in R: https://ggplot2-book.org/maps.html
Geocomputation with R: https://bookdown.org/robinlovelace/geocompr/spatial-class.html
Chapter 16. Geospatial- The Big book of r: https://www.bigbookofr.com/geospatial.html
Statistics
Probability distributions
Probability distributions in R: https://poissonisfish.com/2016/12/04/probability-distributions-in-r/
Bayesian models in R: https://www.r-bloggers.com/2019/05/bayesian-models-in-r-2/
Tables in R
Set of R packages to build beautiful Data Tables in R
gt (Easily Create Presentation-Ready Display Tables): https://gt.rstudio.com/
formattable (produce data structures with formatting rules): https://renkun-ken.github.io/formattable/
kableExtra (Extend kable tables functionality): https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html
db (Interesting DT Package introduction from Yihui Xie website: https://rstudio.github.io/DT/
flextable (Framework for creating tables for reporting and publications): https://ardata-fr.github.io/flextable-book/
reactablefmtr (formatting tables using the reactable R library.): https://kcuilla.github.io/reactablefmtr/index.html
POSIT Community Table Gallery
POSIT Community Table Gallery: https://community.rstudio.com/c/table-gallery/64