Skip to content

Commit

Permalink
Merge pull request #5 from nhs-r-community/add-webr-detail
Browse files Browse the repository at this point in the history
Add webr detail
  • Loading branch information
Lextuga007 authored Oct 22, 2024
2 parents 04e073c + 9107700 commit d88c430
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 351 deletions.
154 changes: 122 additions & 32 deletions 20230613-government-toolshed/NHSRtoolshed.html

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions 20230613-government-toolshed/NHSRtoolshed.qmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
title: "The NHSR Community Toolshed"
title-slide-attributes:
data-background-color: "#43464B"
author: "Zoë Turner"
format:
revealjs:
theme: [default, nhsr-quarto.scss]
logo: https://raw.githubusercontent.com/nhs-r-community/assets/main/logo/nhsr-logo.svg
code-link: true
css: nhsr-quarto.scss
preview-links: true
embed-resources: true
execute:
echo: false
eval: true
Expand Down
175 changes: 70 additions & 105 deletions 20230613-government-toolshed/housekeeping.html

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions 20230613-government-toolshed/housekeeping.qmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
title: "The NHSR Community Toolshed - Housekeeping"
title-slide-attributes:
data-background-color: "#43464B"
author: "Zoë Turner"
format:
revealjs:
theme: [default, nhsr-quarto.scss]
logo: https://raw.githubusercontent.com/nhs-r-community/assets/main/logo/nhsr-logo.svg
code-link: true
css: nhsr-quarto.scss
preview-links: true
embed-resources: true
execute:
echo: false
eval: true
Expand Down
187 changes: 76 additions & 111 deletions 20240614-coffee-coding-quarto/cc-quarto.html

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions 20240614-coffee-coding-quarto/cc-quarto.qmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
title: "NHSR Community Coffee and Coding - Quarto"
title-slide-attributes:
data-background-color: "#43464B"
author: "Zoë Turner"
format:
revealjs:
theme: [default, nhsr-quarto.scss]
logo: https://raw.githubusercontent.com/nhs-r-community/assets/main/logo/nhsr-logo.svg
code-link: true
css: nhsr-quarto.scss
preview-links: true
embed-resources: true
execute:
echo: true
eval: false
Expand Down
3 changes: 3 additions & 0 deletions 20241017-introduce-nhsr/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Introducing NHS-R Community

[Slides](https://presentations.nhsrcommunity.com/20241017-introduce-nhsr/introduce-nhsr.html#/title-slide) to introduce what NHS-R Community is and does.

This presentation includes webr to show a couple of the NHS-R Community R
packages.
2 changes: 1 addition & 1 deletion 20241017-introduce-nhsr/introduce-nhsr.html
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@
};

// Store cell data
globalThis.qwebrCellDetails = [{"id":1,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"false","fig-width":7,"label":"unnamed-chunk-1","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"interactive"},"code":"library(NHSRdatasets)\nlibrary(dplyr)\n\nsub_set <- ae_attendances |>\n filter(org_code == \"RQM\", # the hospital code\n type == 1, # the type of admission\n period < as.Date(\"2018-04-01\")) # dates before 01/04/2018\n\nsub_set"},{"id":2,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"false","fig-width":7,"label":"unnamed-chunk-2","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"interactive"},"code":"library(NHSRplotthedots)\n\nsub_set |>\n ptd_spc(\n value_field = breaches,\n date_field = period,\n improvement_direction = \"decrease\"\n )"},{"id":3,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"true","fig-width":7,"label":"unnamed-chunk-3","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"setup"},"code":"webr::install(\"NHSRepisodes\", repos = c(\"https://nhs-r-community.r-universe.dev\"))"},{"id":4,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"false","fig-width":7,"label":"unnamed-chunk-4","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"interactive"},"code":"library(dplyr)\n\ndat <- tribble(\n ~patient_id, ~admission, ~discharge, ~code, ~notes,\n 1L, \"2020-01-01\", \"2020-01-10\", \"t100\", NA,\n 1L, \"2020-01-12\", \"2020-01-22\", \"t600\", NA,\n 2L, \"2020-05-01\", \"2020-10-01\", \"t100\", NA,\n 2L, \"2020-10-01\", \"2020-11-01\", \"t250\", \"same day discharge and admission\"\n) |>\n # columns must be date format to work with NHSRepisodes functions\n mutate(across(admission:discharge, as.Date)) \n\ndat"},{"id":5,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"false","fig-width":7,"label":"unnamed-chunk-5","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"interactive"},"code":"# Add a column to your data on the episode numbers\ndat |>\n # Rename the columns so that they are recognised by the `add_parent_interval()` function\n select(\n id = patient_id,\n start = admission,\n end = discharge,\n ends_with(\"number\")\n ) |>\n NHSRepisodes::add_parent_interval()"},{"id":6,"options":{"warning":"true","out-width":"700px","fig-height":5,"editor-font-scale":"0.5","comment":"","editor-max-height":"","output":"true","fig-cap":"","results":"markup","autorun":"false","fig-width":7,"label":"unnamed-chunk-6","message":"true","editor-quick-suggestions":"false","out-height":"","dpi":72,"read-only":"false","classes":"","editor-word-wrap":"true","context":"interactive"},"code":"# Add a column to your data on the episode numbers\ndat |>\n # Rename the columns so that they are recognised by the `add_parent_interval()` function\n select(\n id = patient_id,\n start = admission,\n end = discharge,\n ends_with(\"number\")\n ) |>\n NHSRepisodes::merge_episodes()"}];
globalThis.qwebrCellDetails = [{"code":"library(NHSRdatasets)\nlibrary(dplyr)\n\nsub_set <- ae_attendances |>\n filter(org_code == \"RQM\", # the hospital code\n type == 1, # the type of admission\n period < as.Date(\"2018-04-01\")) # dates before 01/04/2018\n\nsub_set","options":{"editor-quick-suggestions":"false","context":"interactive","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"false","fig-cap":"","label":"unnamed-chunk-1","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":1},{"code":"library(NHSRplotthedots)\n\nsub_set |>\n ptd_spc(\n value_field = breaches,\n date_field = period,\n improvement_direction = \"decrease\"\n )","options":{"editor-quick-suggestions":"false","context":"interactive","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"false","fig-cap":"","label":"unnamed-chunk-2","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":2},{"code":"webr::install(\"NHSRepisodes\", repos = c(\"https://nhs-r-community.r-universe.dev\"))","options":{"editor-quick-suggestions":"false","context":"setup","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"true","fig-cap":"","label":"unnamed-chunk-3","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":3},{"code":"library(dplyr)\n\ndat <- tribble(\n ~patient_id, ~admission, ~discharge, ~code, ~notes,\n 1L, \"2020-01-01\", \"2020-01-10\", \"t100\", NA,\n 1L, \"2020-01-12\", \"2020-01-22\", \"t600\", NA,\n 2L, \"2020-05-01\", \"2020-10-01\", \"t100\", NA,\n 2L, \"2020-10-01\", \"2020-11-01\", \"t250\", \"same day discharge and admission\"\n) |>\n # columns must be date format to work with NHSRepisodes functions\n mutate(across(admission:discharge, as.Date)) \n\ndat","options":{"editor-quick-suggestions":"false","context":"interactive","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"false","fig-cap":"","label":"unnamed-chunk-4","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":4},{"code":"# Add a column to your data on the episode numbers\ndat |>\n # Rename the columns so that they are recognised by the `add_parent_interval()` function\n select(\n id = patient_id,\n start = admission,\n end = discharge,\n ends_with(\"number\")\n ) |>\n NHSRepisodes::add_parent_interval()","options":{"editor-quick-suggestions":"false","context":"interactive","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"false","fig-cap":"","label":"unnamed-chunk-5","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":5},{"code":"# Add a column to your data on the episode numbers\ndat |>\n # Rename the columns so that they are recognised by the `add_parent_interval()` function\n select(\n id = patient_id,\n start = admission,\n end = discharge,\n ends_with(\"number\")\n ) |>\n NHSRepisodes::merge_episodes()","options":{"editor-quick-suggestions":"false","context":"interactive","comment":"","output":"true","message":"true","editor-max-height":"","classes":"","fig-height":5,"dpi":72,"out-height":"","results":"markup","read-only":"false","autorun":"false","fig-cap":"","label":"unnamed-chunk-6","editor-word-wrap":"true","out-width":"700px","fig-width":7,"warning":"true","editor-font-scale":"0.5"},"id":6}];

</script><script type="module">
// Declare startupMessageQWebR globally
Expand Down
10 changes: 1 addition & 9 deletions 20241017-introduce-nhsr/introduce-nhsr.qmd
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
title: "Introducing the NHSR Community"
title-slide-attributes:
data-background-color: "#43464B"
author: "Zoë Turner"
format:
revealjs:
theme: [default, nhsr-quarto.scss]
code-link: true
css: nhsr-quarto.scss
preview-links: true
embed-resources: true
execute:
echo: false
eval: true
embed-resources: true
filters:
- "webr"
engine: knitr
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,30 @@ to explain the presentation.

Formats for the folder names will be `yyymmdd-name-of-presentation`

For presentation slides in quarto include `embed-resources: true` in the YAML and
for Rmarkdown `self-contained: true`.
## Code that is applied to all slides

The code `embed-resources: true` will be applied automatically to slides so that
the html generated does not require a separate folder to be formatted.
This code is applied to the entire repository and subfolders as it included in
the `_quarto.yml`.
_Note that the line `embed-resources: true` is needed in the YAML where webr is
used as the supporting folder is generated when the Quarto code `quarto render`
is used on the Terminal_

The style for the slides is generated from the following code which is also
run centrally from the `_quarto.yml` file:

```
title-slide-attributes:
data-background-color: "#43464B"
format:
revealjs:
theme: [default, nhsr-quarto.scss]
logo: https://raw.githubusercontent.com/nhs-r-community/assets/main/logo/nhsr-logo.svg
code-link: true
css: nhsr-quarto.scss
preview-links: true
```

Note that although this code can be used on files in subfolders, each folder
requires the `nhsr-quarto.scss` to be copied to each folder.
15 changes: 12 additions & 3 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
project:
title: "NHSRpresentations"



render:
- "*.qmd"
- "!*.md"
embed-resources: true
format:
revealjs:
theme: [default, nhsr-quarto.scss]
code-link: true
css: nhsr-quarto.scss
preview-links: true
title-slide-attributes:
data-background-color: "#43464B"
58 changes: 0 additions & 58 deletions nhsr-quarto.scss.md

This file was deleted.

0 comments on commit d88c430

Please sign in to comment.