forked from nhs-r-community/NHSR-way
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraining.qmd
273 lines (153 loc) · 12.5 KB
/
training.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# Training {#training .unnumbered}
## Posit Cloud
As of September 2024 NHS-R Community no longer has a paid account to use workspaces and projects for training/workshops.
::: callout-warning
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.
:::
### Posit Cloud terminology
The *workspace* is the overall work area that is managed by a person for a training session or workshop. The *projects* are set up within the workspace and are set to duplicate for individual's to also join the workspace.
### Actively used workspaces \[Archived For Information\]
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 \[Archived For Information\]
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.
### Set up Posit Cloud {#own-cloud}
::: {.callout-tip collapse="false" appearance="default" icon="true"}
## Why use the Posit Cloud? (tip)
If you haven't got R or RStudio on your computer, older versions of these programs or very tight restrictions on work computer networks (VPNs) then you can use the Posit Cloud for the workspace.
There is still some setting up required though so follow the steps for each course and let us know if anything doesn't work or if instructions are not clear at [the core development team](#contact-us).
:::
- 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.
The Cloud is restricted to a certain [number of hours a month](https://posit.cloud/plans) or RAM use as a free account and this should be enough for the purpose of a day workshop.
### Set up your own laptop/computer
::: {.callout-tip collapse="false" appearance="default" icon="true"}
## Why use your own computer? (tip)
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 viewed through the browser on the Cloud.
:::
If you are using your own computer please ensure you have the **latest** [R](https://www.r-project.org/) and [RStudio](https://rstudio.com/products/rstudio/download/) installed. Technical guidance on what programs are required and how to get those installed can be found in the NHSR Community [Statement on Tools](https://tools.nhsrcommunity.com/technical-r.html) book.
It is important to have the latest R installed as older versions have had issues when installing {tidyverse} packages. Errors may come up saying 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](https://community.rstudio.com/t/having-trouble-installing-and-loading-tidyverse-readr-no-hms-package/11268/7) in this post from Posit community may help.
::: callout-warning
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.
:::
### Downloading zip file {#zip-file}
One way of getting files from the GitHub repositories is to download a zip file:

However, there are alternatives that are detailed in each course under the header Get data and whether this is a good way for your own computer or Posit Cloud.
## Introduction to R and RStudio course materials {#intro-r-course}
### Viewing published slides
<https://intro-r-rstudio.nhsrcommunity.com/>
### Installing packages
Installing packages will be part of the course but the instructions can be followed in the pre-work from these [course slide instructions](https://intro-r-rstudio.nhsrcommunity.com/session-packages.html#/packages):
```{r}
#| eval: false
install.packages('tidyverse')
```
Or using the RStudio program and the Packages tab in the bottom right panel which is explained in this [short video](https://www.youtube.com/watch?v=u1r5XTqrCTQ) from Andrew Jahn.
### Get data - own computer
As well as the packages for the course you will also need to install the packages {usethis} and {here} installed run the following code:
```{r}
#| eval: false
# install.packages(c("usethis", "here"))
usethis::use_course("nhs-r-community/intro_r_data", destdir = here::here())
```
### Get data - Posit Cloud
Connect directly from GitHub repository by clicking on the blue button for `New Project` in the top right from the main screen. From the drop down that appears select `New Project from Git Repository`, then copy the following URL into the text which can be found in the particular workshop sections:
`https://github.com/nhs-r-community/intro_r_data`
{fig-alt="Screenshot of Posit Cloud with the pop up with the box \"URL of your Git Repository\""}
### Downloading course slides **only**
::: {.callout-note collapse="false" appearance="default" icon="true"}
## Not a necessary step!
All the slides are published through GitHub to a redirected URL so should be available to all organisations. However, if you would still like to get copies then follow this section.
Note that the files are html for greater accessibility and we do not provide the slides as PowerPoint or pdf.
:::
Slides can be downloaded from a separate repository <https://github.com/nhs-r-community/intro_r/tree/gh-pages> using the same process as for [downloading zip file](#zip-file).
These are just the slides and not the underlying code used to produce the slides which can be found in the main repository <https://github.com/nhs-r-community/intro-r-rstudio>. We have separated the code from the published slides and the data to not overwhelm beginners to R as there a lot of files!
## Intermediate R {#intermediate}
This course expects a level of prior experience and understanding of R.
Currently this course is script based and does not come in slide form.
### Installing packages
Packages used:
``` r
install.packages(c("tidyverse", "NHSRdatasets", "pacman", "janitor", "zoo",
"tm", "glue", "NHSRplotthedots"))
```
### Get data - own computer
As well as the packages for the course you will also need to install the packages {usethis} and {here} installed run the following code:
```{r}
#| eval: false
# install.packages(c("usethis", "here"))
usethis::use_course("nhs-r-community/intermediate_R_training", destdir = here::here())
```
### Get data - Posit Cloud
Connect directly from GitHub repository by clicking on the blue button for `New Project` in the top right from the main screen. From the drop down that appears select `New Project from Git Repository`, then copy the following URL into the text which can be found in the particular workshop sections:
`https://github.com/nhs-r-community/intermediate_R_training`
{fig-alt="Screenshot of Posit Cloud with the pop up with the box \"URL of your Git Repository\""}
Course scripts are available on GitHub <https://github.com/nhs-r-community/intermediate_R_training/tree/main>
## Introduction to Git and GitHub using R course materials {#intro-git}
### Viewing published slides
<https://intro-git-github.nhsrcommunity.com/>
### Installing packages
Follow the [course slide](https://intro-git-github.nhsrcommunity.com/session-prework.html#/install-packages).
### GitHub account
To use GitHub you will need to:
- register and account at [GitHub](https://github.com/)
- and set up [2FA (two factor authentication)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-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 <https://github.com/nhs-r-community/intro-git-github#introduction-to-git-and-github> follow the instructions on [downloading data](#step-two).
## Introduction to Quarto course materials {#intro-quarto}
### Viewing published slides
<https://intro-quarto.nhsrcommunity.com/>
### Installing packages
The following packages are used which are not on CRAN and so require {remotes} (and cannot be installed via the RStudio packages wizard):
``` r
install.packages("remotes")
remotes::install_github("nhs-r-community/NHSRdatasets")
remotes::install_github("matt-dray/quartostamp")
```
Packages from CRAN:
``` r
install.packages(c("tidyverse", "knitr"))
```
### Get data - own computer
As well as the packages for the course you will also need to install the packages {usethis} and {here} installed run the following code:
```{r}
#| eval: false
# install.packages("usethis", "here")
usethis::use_course("nhs-r-community/intro_quarto_data", destdir = here::here())
```
### Get data - Posit Cloud
Connect directly from GitHub repository by clicking on the blue button for `New Project` in the top right from the main screen. From the drop down that appears select `New Project from Git Repository`, then copy the following URL into the text which can be found in the particular workshop sections:
{fig-alt="Screenshot of Posit Cloud with the pop up with the box \"URL of your Git Repository\""}
`https://github.com/nhs-r-community/intro_quarto_data`
### 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`](https://github.com/nhs-r-community/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 {#shiny}
### Viewing published slides
<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:
``` r
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 <https://github.com/nhs-r-community/shiny-beginners> follow the instructions on [downloading data](#step-two).
## Workshop confirmation emails
The NHS-R Community confirmation email will include:
- the link to the workshop
- a calendar invitation
## 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](#contact-us) for workshops and conferences but are not provided as standard and we have not registered officially for any CPD points for these courses.
To confirm attendance we will check the event registration (in person with a scanned QR code for example and virtually through the registration data generated from logging in).
Note that we will only keep a record of who signed up to an event for the amount of time determined by our [event data retention](#retention).