Skip to content

Commit

Permalink
Add population data to index
Browse files Browse the repository at this point in the history
Include current population data in index. Rephrased about section. Include version number in app title on home page and subheading about seciton.
  • Loading branch information
b-kennedy0 committed Jan 23, 2021
1 parent d445477 commit 5abab6e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
17 changes: 16 additions & 1 deletion server.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server <- function(input, output) {

# Latest Date
# Latest Date ----------------------------------------------------------
latest <- format(as.Date(max(dataset$date)), format = "%d/%m/%Y")
output$latest_date <- renderText({
latest
Expand All @@ -14,6 +14,21 @@ server <- function(input, output) {
uk_pop <- sum(eng_pop,wal_pop,sco_pop,ni_pop)
uk_total <- sum(dataset$cumPeopleVaccinatedFirstDoseByPublishDate
[dataset$date==max(dataset$date)])
# Population data formatted for use in index -----------------------------
output$england <- renderText({
format(as.numeric(eng_pop), big.mark = ",")
})
output$wales <- renderText({
format(as.numeric(wal_pop), big.mark = ",")
})
output$scotland <- renderText({
format(as.numeric(sco_pop), big.mark = ",")
})
output$northernireland <- renderText({
format(as.numeric(ni_pop), big.mark = ",")
})

# Formatting vaccine data (% and No) for use in index ----------------------

# Total % UK Vaccines
output$total_uk_perc <- renderText({
Expand Down
20 changes: 20 additions & 0 deletions ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ ui = shiny::htmlTemplate(
inline = T
),

england = textOutput(
"england",
inline = T
),

wales = textOutput(
"wales",
inline = T
),

scotland = textOutput(
"scotland",
inline = T
),

northernireland = textOutput(
"northernireland",
inline = T
),

total_perc_vaccines_uk = textOutput(
"total_uk_perc",
inline = T
Expand Down
17 changes: 12 additions & 5 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h3>Navigation</h3>

<div class="row home-content__main">

<h3>COVID-19 Vaccination Data (UK)</h3>
<h3>COVID-19 UK Vaccination Data (App {{version}})</h3>

<h1>
This app shows the<br>
Expand Down Expand Up @@ -227,6 +227,7 @@ <h4 class="subhead"><em>Tap/Click on the Nations to show/hide them</em></h4>
<div class="col-full">
<h3 class="subhead">About this App</h3>
<h1 class="display-2">COVID-19 Vaccination Progress App</h1>
<h3 class="subhead">{{version}}</h3>
</div>
</div> <!-- end section-header -->

Expand All @@ -238,7 +239,7 @@ <h1 class="display-2">COVID-19 Vaccination Progress App</h1>
</div>
<div class="service-text">
<h3 class="h2">Keeping You Updated</h3>
<p>The app was created to enable the centralised sharing of UK-wide vaccination progress. Each NHS service (England, Wales, Scotland, Northern Ireland) are each publishing their vaccination data and this is collated into the <a href="https://coronavirus.data.gov.uk" target="_blank">Government Dashboard</a>. The Government Dashboard isn't the clearest at presenting the vaccine data so this app was created to do that. Created using R and RStudio.</p>
<p>The app was created to share UK-wide vaccination progress. Every day, each NHS service is publishing their data, collated on the <a href="https://coronavirus.data.gov.uk" target="_blank">Government Dashboard</a>. However, the government dashboard isn't the easiest to use and so this app was created to do that.</p>
</div>
</div>

Expand All @@ -248,7 +249,7 @@ <h3 class="h2">Keeping You Updated</h3>
</div>
<div class="service-text">
<h3 class="h2">Simple Design</h3>
<p>The app was designed to run in a web browser on all device types. It is aimed to be as clear and simple as possible.</p>
<p>The app was coded using R, RStudio and ShinyApps. It is designed to run in a web browser on all device types with the aim of being as clear and simple as possible.</p>
</div>
</div>

Expand All @@ -268,8 +269,14 @@ <h3 class="h2">Spreading Hope</h3>
<i class="icon-clock"></i>
</div>
<div class="service-text">
<h3 class="h2">Data Refresh</h3>
<p>The data for the app is refreshed daily as the NHS services publish their data. <a href="https://coronavirus.data.gov.uk/" target="_blank">View data source.</a> Although the data is pulled daily, depending on what time you view the app, it is possible that the data is one/two days old as the latest data has not yet been published.
<h3 class="h2">App Data Refresh</h3>
<p>The data is refreshed daily. However, depending on when you view the app, it is possible that the data is one/two days old as the latest data has not yet been published.<br />Population data is estimated from the <a href="https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationestimates" target="_blank" rel="noopener">Office for National Statistics</a> (ONS). Currently using the following figures:
<ul class="stats-tabs">
<li><a>{{england}} <em>England</em></a></li>
<li><a>{{wales}} <em>Wales</em></a></li>
<li><a>{{scotland}} <em>Scotland</em></a></li>
<li><a>{{northernireland}} <em>Northern Ireland</em></a></li>
</ul>
</p>
</div>
</div>
Expand Down

0 comments on commit 5abab6e

Please sign in to comment.