-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.R
36 lines (23 loc) · 867 Bytes
/
global.R
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
library(shiny)
library(shinydashboard)
library(xml2)
library(dplyr)
library(ggplot2)
library(plotly)
library(RColorBrewer)
options(shiny.fullstacktrace = TRUE)
source('utils.R')
mypalette<-brewer.pal(3,"Dark2")
webpage_url <- "https://www.sst.dk/da/corona/tal-og-overvaagning"
tables <- get_hosp_table(web_url = webpage_url)
hosp <- prepare_table(tables$hosp)
hosp_long <- elong_table(hosp)
intens <- prepare_table(tables$intens)
intens_long <- elong_table(intens)
resp <- prepare_table(tables$resp)
resp_long <- elong_table(resp)
joined <- left_join(hosp, intens, by = "Date", suffix = c("", "_intens")) %>%
left_join(resp, by = "Date", suffix = c("_hosp", "_resp"))
# Region plots --------------------------------------------------------------------------------
regs <- grep("Region", colnames(tables$hosp), value = TRUE)
reg_plots <- plotList(regs)