HDRUdashboard: Generate a PDF report from the data.

Description Usage Arguments Value Examples

View source: R/HDRU_dashboard.R

Description

Generates an HTML report containing summaries of the data, including comparison of lengths of hospital stay by sex and age group, outcome by sex, comorbidity, symptom and treatment distributions and distribution of vital signs on presentation at hospital.

Usage

1
2
3
4
5
6
7
8
9
HDRUdashboard(
  admissionData,
  dailyData,
  curPeriod,
  unit = "week",
  minDay = NULL,
  maxDay = NULL,
  file.name
)

Arguments

admissionData

Data table with the current admission data from the MLW data portal

dailyData

Data frame with the current daily data from the MLW data portal

curPeriod

Character string vector in yyyy-mm-dd format; giving the Mondays of the weeks to include in the report (if unit=="week"); e.g. dmy("2020"/07/06,"2020/07/13","2020/07/20","2020/07/27") or the start of the months (if unit="month") to include; e.g. dmy("2020/04/01","2020/05/01","2020/06/01","2020/07/01")

unit

Character string that is either 'week' or 'month' giving the grouping to use for the bar plots

minDay

Character string in yyy-mm-dd format indicating the start of the period to summarise; defaults to NULL (in this case determined from curPeriod); if both minDay and maxDay are not NULL, then they determine the range of records to include in the tables and the plots that are not stratified by week or month

maxDay

Character string in yyy-mm-dd format indicating the end of the period to summarise; defaults to NULL (in this case determined from curPeriod); if both minDay and maxDay are not NULL, then they determine the range of records to include in the tables and the plots that are not stratified by week or month

file.name

Path to a html file to write the dashboard to

Value

Html dashboard visualising the provided HDRU data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# You will need to
#  * Load the admission data from the data portal (argument admissionData).
#  * Load the daily data from the data portal (argument dailyData).
#  * Set the weeks for which you want summaries (argument curWeek).
#  * Specify a file name (with .html extension) that will contain the dashboard report.
# The example below assumes you've got the 2 input data files sitting in your working directory.
# Once you have run the HDRUdashboard() function, open the specified output html file.

library(HDRU)

admissionData<-read.csv("hdru_admission_raw.csv")
dailyData<-read.csv("hdru_daily_raw.csv")
curWeek<-dmy("06/07/2020","13/07/2020","20/07/2020","27/07/2020")

HDRUdashboard(admissionData=admissionData,dailyData=dailyData,curWeek=curWeek,file.name="HDRUdashboard.html")

mlw-stats/HDRU documentation built on Jan. 1, 2021, 10:30 a.m.