Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

Commit

Permalink
remove recovered
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoene committed Mar 24, 2020
1 parent 42a4d92 commit 23bb902
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: coronavirus
Title: Tracking the Coronavirus
Version: 0.1.3
Version: 0.1.4
Authors@R: person('John', 'Coene', email = 'jcoenep@gmail.com', role = c('cre', 'aut'))
Description: Tracking the Coronavirus.
License: MIT + file LICENSE
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,3 +1,7 @@
# coronavirus 0.1.4

- Updated JHU data source, no longer provides recovered data

# coronavirus 0.1.3

- Meet new country naming convention of John Hopkins data.
Expand Down
2 changes: 0 additions & 2 deletions R/app_server.R
Expand Up @@ -61,7 +61,6 @@ app_server <- function(input, output,session) {
# counts jhu
callModule(mod_count_server, "count_ui_1", df = df, type_filter = "confirmed")
callModule(mod_count_server, "count_ui_2", df = df, type_filter = "death")
callModule(mod_count_server, "count_ui_3", df = df, type_filter = "recovered")

# counts weixin
callModule(
Expand Down Expand Up @@ -145,7 +144,6 @@ app_server <- function(input, output,session) {
# jhu tab
callModule(mod_count_server, "count_ui_1_jhu", df = df, type_filter = "confirmed")
callModule(mod_count_server, "count_ui_2_jhu", df = df, type_filter = "death")
callModule(mod_count_server, "count_ui_3_jhu", df = df, type_filter = "recovered")

# trend
callModule(mod_trend_server, "trend_ui_1", df = df)
Expand Down
6 changes: 0 additions & 6 deletions R/app_ui.R
Expand Up @@ -55,9 +55,6 @@ app_ui <- function() {
),
f7Col(
mod_count_ui("count_ui_2", "Deaths")
),
f7Col(
mod_count_ui("count_ui_3", "Recovered")
)
),
h2("Weixin Data", class = "center"),
Expand Down Expand Up @@ -98,9 +95,6 @@ app_ui <- function() {
f7Col(
mod_count_ui("count_ui_2_jhu", "Deaths")
),
f7Col(
mod_count_ui("count_ui_3_jhu", "Recovered")
)
),
mod_new_cases_ui("new_cases"),
f7Row(
Expand Down
10 changes: 5 additions & 5 deletions R/crawl.R
Expand Up @@ -23,26 +23,26 @@ crawl_coronavirus <- function(){
# read data
suppressMessages({
confirmed <- readr::read_csv(confirmed_sheet, col_types = readr::cols())
recovered <- readr::read_csv(recovered_sheet, col_types = readr::cols())
#recovered <- readr::read_csv(recovered_sheet, col_types = readr::cols())
deaths <- readr::read_csv(deaths_sheet, col_types = readr::cols())
})

# add col
confirmed$type <- "confirmed"
recovered$type <- "recovered"
#recovered$type <- "recovered"
deaths$type <- "death"

# rename
confirmed <- rename_sheets(confirmed)
recovered <- rename_sheets(recovered)
#recovered <- rename_sheets(recovered)
deaths <- rename_sheets(deaths)

# pivot longer
confirmed <- pivot(confirmed)
recovered <- pivot(recovered)
#recovered <- pivot(recovered)
deaths <- pivot(deaths)

df <- dplyr::bind_rows(confirmed, recovered, deaths) %>%
df <- dplyr::bind_rows(confirmed, deaths) %>%
dplyr::mutate(
date = as.Date(date, format = "%m/%d/%y"),
cases = trimws(cases),
Expand Down
4 changes: 2 additions & 2 deletions R/mod_jhu_death_rate.R
Expand Up @@ -21,7 +21,7 @@ mod_jhu_death_rate_ui <- function(id){
echarts4r::echarts4rOutput(ns("trend"), height = 395),
footer = f7Row(
f7Col(uiOutput(ns("copy_ui"))),
f7Col("deaths / (confirmed + recovered)")
f7Col("deaths / confirmed")
)
)
}
Expand Down Expand Up @@ -65,7 +65,7 @@ mod_jhu_death_rate_echarts <- function(df){
)
) %>%
dplyr::mutate(
rate = death / (confirmed + recovered),
rate = death / (confirmed),
rate = round(rate * 100, 3)
) %>%
echarts4r::e_charts(date) %>%
Expand Down
2 changes: 0 additions & 2 deletions R/mod_table.R
Expand Up @@ -44,13 +44,11 @@ mod_china_server <- function(input, output, session, df){
dplyr::arrange(-confirmed) %>%
dplyr::mutate(
confirmed = as.integer(confirmed),
recovered = as.integer(recovered),
death = as.integer(death)
) %>%
dplyr::select(
Province = state,
Confirmed = confirmed,
Recovered = recovered,
Deaths = death
) %>%
as_f7_table(card = TRUE)
Expand Down
2 changes: 0 additions & 2 deletions R/mod_table_world.R
Expand Up @@ -47,13 +47,11 @@ mod_table_world_server <- function(input, output, session, df){
dplyr::arrange(-confirmed) %>%
dplyr::mutate(
confirmed = as.integer(confirmed),
recovered = as.integer(recovered),
death = as.integer(death)
) %>%
dplyr::select(
Country = country,
Confirmed = confirmed,
Recovered = recovered,
Deaths = death
) %>%
as_f7_table(card = TRUE)
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Expand Up @@ -4,8 +4,8 @@ theme <- "dark"
dxy_url <- "https://ncov.dxy.cn/ncovh5/view/pneumonia"

# jhu
confirmed_sheet <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv"
deaths_sheet <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv"
confirmed_sheet <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
deaths_sheet <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv"
recovered_sheet <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Recovered.csv"

# pallettes for DXY
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Expand Up @@ -2,7 +2,7 @@

![logo](_media/microbe.png)

# Coronavirus <small>0.1.0</small>
# Coronavirus <small>0.1.4</small>

> An open-source nCov-2019 tracker.
Expand Down
4 changes: 4 additions & 0 deletions docs/news.md
@@ -1,5 +1,9 @@
# Changelog

## coronavirus 0.1.4

- Updated JHU data source, no longer provides recovered data

## coronavirus 0.1.3

- Meet new country naming convention of John Hopkins data.
Expand Down

0 comments on commit 23bb902

Please sign in to comment.