This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(tidyverse) | |
library(DT) | |
load("ae_attendances.RData") | |
Sys.sleep(10) | |
# filter to random 10 Trusts with a decent amount of data in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Data load | |
library(tidyverse) | |
library(RMySQL) | |
library(readxl) | |
main <- read_excel("JISC_05-02-20.xlsx", skip = 1) %>% | |
rename(TeamC = `Team Number`, Date = CompletionDate) %>% | |
select(-starts_with("1."), -starts_with("2."), -starts_with("3."), -starts_with("4.")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/HFAnalyticsLab | |
https://github.com/codonlibrary | |
https://github.com/royal-free-london | |
https://github.com/PublicHealthEngland | |
https://github.com/nhsuk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Binomial confidence intervals" | |
author: "Chris Beeley" | |
date: "20/06/2019" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
library(tidyverse) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(input, output) { # define application in here | |
output$textDisplay <- renderText({ # mark function as reactive | |
# and assign to output$textDisplay for passing to ui.R | |
paste0("You said '", input$comment, # from the text | |
"'. There are ", nchar(input$comment), # input control as | |
" characters in this.") # defined in ui.R | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixedData[, missnum > 2] %>% | |
gather(L1, value) %>% | |
filter(!is.na(value)) %>% | |
left_join(select(questionFrame, code, value), by = c("L1" = "code")) %>% | |
select(-L1) %>% | |
group_by(value.y) %>% | |
count(value.x) %>% | |
mutate(prop = prop.table(n) * 100) %>% | |
select(-n) %>% | |
mutate(value.x = factor(value.x, levels = 1:5)) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
#> Warning: package 'tidyverse' was built under R version 3.4.4 | |
#> -- Attaching packages ----------------------------------------------------------------------------------------------- tidyverse 1.2.1 -- | |
#> v ggplot2 3.0.0 v purrr 0.2.4 | |
#> v tibble 1.4.2 v dplyr 0.7.6 | |
#> v tidyr 0.8.1 v stringr 1.3.0 | |
#> v readr 1.1.1 v forcats 0.3.0 | |
#> Warning: package 'ggplot2' was built under R version 3.4.4 | |
#> Warning: package 'tibble' was built under R version 3.4.4 | |
#> Warning: package 'readr' was built under R version 3.4.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Shiny function to receive messages | |
Shiny.addCustomMessageHandler("sendMessage", | |
function(message) { | |
// call this before modifying the DOM | |
Shiny.unbindAll(); | |
/* delete the dropdown if it already |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) # load Shiny at the top of both scripts | |
shinyServer(function(input, output) { # define application in here | |
output$textDisplay <- renderText({ # mark function as reactive | |
# and assign to output$textDisplay for passing to ui.R | |
paste0("You said '", input$comment, # from the text | |
"'. There are ", nchar(input$comment), # input control as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Basic RMarkdown Shiny" | |
author: "Chris Beeley" | |
output: html_document | |
runtime: shiny | |
--- | |
# Example RMarkdown document | |
This is an interactive document written in *markdown*. As you can see it is easy to include: |