Training
Posit Cloud
NHS-R Community pay for an account to use workspaces and projects for training/workshops. These mean that people can have projects that are set up with all the packages they require, have access to the latest version of R and RStudio and projects can be preloaded with any scripts or data. This account is also used for technical training hosted by The Strategy Unit.
As Posit Cloud is hosted in the US this is used only for training where data is publicly available and the recommendation is to never use the Cloud for analysis of any sensitive data.
The Posit Cloud account is monitored and maintained by admins who have access to all projects and individual’s projects in the workspaces. Admins can be contacted through the core development team.
Administrators accessing projects
Accessing projects can be helpful to see code issues that cannot be shared by any other method. However, this can only occur with an account with admin rights. Also, only one person can be in a project at any one time so accessing a project as admin will result in the project owner being forced to leave.
Deletion of Posit workspaces and projects
To ensure that the Cloud is manageable and being used appropriately, projects can be moved by their creator to their own personal workspace.
Actively used workspaces
Projects in active workspaces, like the Introduction to R and R Studio workshop, will be archived after 3 months which means the project isn’t counted in the Cloud usage but is still retrievable.
One off workspaces
Workspaces for one off events like at conferences will be archived after 3 months and deleted after 6 months.
Prework for attendees
Equipment - screens
Many of the course and workshop formats expect a “code along” approach which is best done with 2 screens for comfort of moving between the demonstration and using RStudio on your computer.
Where users use two separate computers to enable having 2 screens, this may cause issues with sharing code in the chat functions and it will not be possible to share the coding screen for debugging support. If the person is using a Posit Cloud workspace and the course leader is an administrator then the course leader can access the project to debug.
Set up Posit Cloud
Sign up for a free Posit Cloud account at https://posit.cloud/ before the workshop. Log in with either an existing Google or GitHub account, or alternatively set up an account directly with Posit Cloud.
NHS-R Community will send an email confirmation that will include the specific Posit Cloud work space invitation link.
All the files and necessary packages are pre-loaded to the Cloud work space.
When you first log in with the link shared in the email it will take you to an Posit Cloud screen that says about Joining a space. Click on the blue button for Join Space:
The next screen that loads is a welcome page to the workshop and the final screen will have a project in it that, in this example, is called Intro_R_RStudio
. When this is selected the project gets copied so you will see both the original Intro_R_RStudio
and your own new one called Untitled
. Although the word continue
appears next to the original screen you will open your copy.
Difference between NHS-R workspaces and your own
You will be restricted to a certain number of hours a month on the free account which should be enough for the purpose of a day workshop, however, the NHS-R work space doesn’t, currently, have that restriction.
Taking the scripts to your own workspace
To move the project you’ve created to your own work space (which is available with the account you set up) select the moving trolley icon:
Then select Your work space
. If you’ve been invited to any other work space you will also see them in the same Move Content screen:
It’s possible to download your files instead by using the down arrow by the Project.
Using your own laptop/computer
Some VPNs (Virtual Private Networks) block access to Posit Cloud or you may wish to use your own computer. VPNs sometimes do work but block parts of the R functionality, this is particularly a problem with Shiny apps.
If that is the case please ensure you have the latest R and RStudio installed. Technical guidance on what programs are required and how to get those installed can be found in the NHSR Community Statement on Tools book.
It is important to have the latest R installed as older versions of R have had issues when installing {tidyverse} packages. Errors say that packages like broom
or readr
cannot be installed but even when this has been installed separately there continue to be other errors. Some of the answers in this post from Posit community may help.
If you require permission for programs to be installed on your computer by an IT department, it is worth getting agreement to also have these updated by your IT department regularly or by request as it is always good practice for fixing issues and bugs.
Introduction to R and RStudio course materials
Viewing published slides
All course slides are available, published through GitHub but redirected through the NHS-R Community url to https://intro-r-rstudio.nhsrcommunity.com/
Installing packages
Packages are installed on the cloud as part of the course but the slide about packages from the course has details of the main package used and the code required to install.
Other packages mentioned in the course (but are also installed as part of the learning) are:
install.packages(c("beepr", "styler", "janitor", "stringr", "stringi"))
Downloading data
The Introduction to R and RStudio workshop data used in the course can be found in a specific repository
https://github.com/nhs-r-community/intro_r_data
Click on the green
The following code can be run from the Console in RStudio to download the same files:
install.packages("usethis")
::use_course("nhs-r-community/intro_r_data") usethis
Downloading course slides only
This is not necessary for the course
If you want to have the slides on your computer, they can be downloaded from another repository. Using the same process as for Downloading files
above you can download these to your computer by clicking on the green button and selecting the zip download.
This is just the slides and not the underlying code used to produce the slides.
Introduction to Git and GitHub using R course materials
Viewing published slides
All course slides are available, published through GitHub but redirected through the NHS-R Community url to https://intro-git-github.nhsrcommunity.com/
Installing packages
The following slide published through GitHub details the packages used in the course.
GitHub account
To use GitHub you will need to:
- register and account at GitHub
- and set up 2FA (two factor authentication).
Downloading all course material
This is not necessary for the course
To download all the files (including the slides) then on the main GitHub repository click on the green
Introduction to Quarto course materials
Viewing published slides
All course slides are available, published through GitHub but redirected through the NHS-R Community url to https://intro-quarto.nhsrcommunity.com/
Downloading data
The Introduction to Quarto materials can be found in a specific module. Click on the green
The following code can be run from the Console in RStudio to download the same files:
install.packages("usethis")
::use_course("nhs-r-community/intro_quarto_data") usethis
Installing packages
Packages are installed as part of the course on the cloud but the following are used which are not on CRAN and so require {remotes}:
install.packages("remotes")
::install_github("nhs-r-community/NHSRdatasets")
remotes::install_github("matt-dray/quartostamp") remotes
As well as the following packages from CRAN:
install.packages(c("tidyverse", "knitr"))
Downloading all course material
This is not necessary for the course and excludes the data which is from a different repository
If you want to have the slides on your computer, they can be downloaded from the repository intro-quarto
. Using the same process as for Downloading files
above you can download these to your computer by clicking on the green button and selecting the zip download.
Shiny beginners course materials
Viewing published slides
All course slides are available, published through GitHub but redirected through the NHS-R Community url to https://shiny-beginners.nhsrcommunity.com/
Installing packages
Packages are installed as part of the course on the cloud but the following are used which are:
install.packages(c("tidyverse", "shiny", "bslibs"))
Downloading all course material
This is not necessary for the course
To download all the files (including the slides) then on the main GitHub repository click on the green
Workshop confirmation emails
The NHS-R Community confirmation email will include:
- the link to the workshop
- the Posit Cloud specific workspace url and
- a calendar invitation
If you are not sure that you can access Zoom from your work laptop, please request a test Zoom meeting coordinated by the core development team.
Modern desktop users (NHS England)
Some organisations are using a modern desktop system, please note that project do not appear to work with Projects/setwd
and files like RMarkdown and Quarto don’t appear to work, giving the error:
Warning message: In options(stringsAsFactors = TRUE) : ‘options(stringsAsFactors = TRUE)’ is deprecated and will be disabled Error in setwd(“C:/R/WorkingDir”) : cannot change working directory Execution halted
Currently, the way around this is to create the missing folder “C:/R/WorkingDir” (so WorkingDir folder in a folder called R on the C: drive) and whilst the warning message will remain the report scripts .rmd
and .qmd
will work. The other recommendation is currently to work through UDAL if there is access.
Certificates of attendance
Certificates for Continual Profession Development can be requested from the core development team for workshops and conferences but are not provided as standard.