Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Restructure slightly #22

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
323 changes: 211 additions & 112 deletions introduction.html → 01-introduction.html

Large diffs are not rendered by default.

113 changes: 26 additions & 87 deletions introduction.qmd → 01-introduction.qmd
Original file line number Diff line number Diff line change
@@ -1,82 +1,43 @@
---
title: "Introduction to Shiny"
subtitle: "Session - Introduction"
title: "Introduction"
---

## Agenda - session one (about 2 hours)
## Welcome

Chapter overview
- We'll have regular breaks
- Material available at [github.com/nhs-r-community/shiny-beginners](https://github.com/nhs-r-community/shiny-beginners)
- Ask questions

::: {.fragment .fade-in}
Introduction and getting started
:::

::: {.fragment .fade-in}
What is Shiny?
:::

::: {.fragment .fade-in}
--------- Break -----------
:::

::: {.fragment .fade-in}
What does it do?
:::

::: {.fragment .fade-in}
Intro to reactivity
:::

::: {.fragment .fade-in}
Application 1 - minimal (Your first application)\
Application 2 - Sitrep (Situation Report)
:::

::: {.fragment .fade-in}
Reactive expressions
:::
## What is Shiny?

::: {.fragment .fade-in}
(Optional)\
NSE in Shiny applications\
Bookmarks
:::
- Shiny is a web application programming framework
- The language of the web (HTML, JavaScript, and CSS) all called from R
- It requires no knowledge of HTML, JavaScript, or CSS, but if you have that knowledge you can add more of these languages

::: {.fragment .fade-in}
--------- Course end -----------
:::
## Examples of Shiny

## Agenda - session two (about 2 hours)
The [Shiny Gallery](https://shiny.posit.co/r/gallery/) which includes dashboards as well as parts (widgets) that can be added.

Chapter overview
And from healthcare:

::: {.fragment .fade-in}
--------- Course end -----------
:::
[![](https://github.com/traffordDataLab/imd19/raw/master/screenshot.png){fig-alt="Screenshot of the Indices of Deprivation 2019 dashboard from Trafford Data lab"}](https://trafforddatalab.shinyapps.io/imd19)

## Agenda - session three (about 2 hours)
## Mental Health Surge Model app

Chapter overview
[![](img/mental_health_modelling.PNG){fig-alt="Screenshot of Mental Health Modelling app from The Strategy Unit used to estimate the impacts of COVID-19 on mental health services in England"}](https://strategyunit.shinyapps.io/MH_Surge_Modelling/)

::: {.fragment .fade-in}
--------- Course end -----------
:::
## Patient Feedback text mining app

## What is Shiny?
[![](img/screenshot-pxtextmining.PNG){fig-alt="Screenshot of Patient Text Mining app from Nottinghamshire Healthcare NHS Foundation Trust (via funding from NHS England)"}](https://cdu-data-science-team.github.io/pxtextmining/)

::: incremental
- Shiny is a web application programming framework
- The language of the web (HTML, JavaScript, and CSS) all called from R
- It requires no knowledge of HTML, JavaScript, or CSS, but if you have that knowledge you can add more of these languages
:::

## Let's create a shiny app - on a computer
## Create an example shiny app

::: incremental
- Go to `File > New Project... > New Directory`
- Select `Shiny Application`
- Browse to the location you want the new folder to go to
- Name your new project!
- Name your new project
:::

. . .
Expand Down Expand Up @@ -142,41 +103,19 @@ Before closing the app look at the R Console:

The workflow is:

::: {.incremental}
- Write code
- Start app
- Play with app
- Write more code
- Repeat
- And in RStudio you don't need to stop and start just `Reload app`
:::

In RStudio you don't need to stop and start just `Reload app`

## Examples of Shiny

The [Shiny Gallery](https://shiny.posit.co/r/gallery/) which includes dashboards as well as parts (widgets) that can be added.

And from healthcare:
## Your turn

[![](https://github.com/traffordDataLab/imd19/raw/master/screenshot.png){fig-alt="Screenshot of the Indices of Deprivation 2019 dashboard from Trafford Data lab"}](https://trafforddatalab.shinyapps.io/imd19)

## Mental Health Surge Model app

[![](img/mental_health_modelling.PNG){fig-alt="Screenshot of Mental Health Modelling app from The Strategy Unit used to estimate the impacts of COVID-19 on mental health services in England"}](https://strategyunit.shinyapps.io/MH_Surge_Modelling/)

## Patient Feedback text mining app

[![](img/screenshot-pxtextmining.PNG){fig-alt="Screenshot of Patient Text Mining app from Nottinghamshire Healthcare NHS Foundation Trust (via funding from NHS England)"}](https://cdu-data-science-team.github.io/pxtextmining/)

## The future of Shiny - is here!

As RStudio renamed to Posit in 2022 to extend their language association beyond R, so they are also working on extending Shiny apps

::: {.incremental}
- To be compatible with the power of [Python](https://shiny.posit.co/py/)
- To publish without a server using [Shinylive](https://jcheng5.github.io/posit-conf-2023-shinylive/#/title-slide)
- An example is this [app](https://matt-dray.github.io/govspeakify-tables/) that converts a table to Govspeak Markdown, the format required for publishing reports by the UK's government from Matt Dray's [blog](https://www.rostrum.blog/posts/2023-10-08-govspeakify-tables/)
:::
- Use `File > New File > Shiny Web App...`
- Drag the slider and see the histogram change
- Change the colour of the histogram fill to "blue"
- Change the title of the application

## End session

Expand All @@ -186,4 +125,4 @@ As RStudio renamed to Posit in 2022 to extend their language association beyond
[Beginners course by Chris Beeley](https://github.com/ChrisBeeley/shiny_beginners/tree/main) aimed at relatively novice R users
[Shiny workshop for NHS-R Community](https://www.youtube.com/watch?v=wEYaeltxlys&list=PLXCrMzQaI6c1Na7BE18OsWtE1WKqrclNn&index=27)
[Shiny workshop materials](https://github.com/nhs-r-community/shiny-training) on the NHS-R Community GitHub.
[Building Web Apps with R Shiny](https://debruine.github.io/shinyintro/first-app.html) from [PsyTeachR](https://psyteachr.github.io/)
[Building Web Apps with R Shiny](https://debruine.github.io/shinyintro/first-app.html) from [PsyTeachR](https://psyteachr.github.io/)
Loading