knitr::opts_chunk$set( collapse = TRUE, dpi=200, comment = "#>", fig.path = "man/figures/README-africa-", out.width = "100%" )
This package curate (downloads, clean, consolidate, smooth) data from Johns Hokpins for analysing international outbreak of COVID-19.
It includes several visualizations of the COVID-19 international outbreak.
Yanchang Zhao, COVID-19 Data Analysis with Tidyverse and Ggplot2 - China. RDataMining.com, 2020.
URL: http://www.rdatamining.com/docs/Coronavirus-data-analysis-china.pdf.
Data is still noisy because there are missing data from some regions in some days. We are working on in it.
| Release | Usage | Development | |:--------|:------|:------------| | | | | | | | | ||||
Install the R package using the following commands on the R console:
# install.packages("devtools") devtools::install_github("rOpenStats/COVID19analytics", build_opts = NULL)
library(COVID19analytics) library(dplyr)
data.processor <- COVID19DataProcessor$new(provider = "JohnsHopkingsUniversity", missing.values = "imputation") #dummy <- data.processor$preprocess() is setupData + transform is the preprocess made by data provider dummy <- data.processor$setupData() dummy <- data.processor$transform() # Curate is the process made by missing values method dummy <- data.processor$curate() current.date <- max(data.processor$getData()$date) rg <- ReportGeneratorEnhanced$new(data.processor) rc <- ReportGeneratorDataComparison$new(data.processor = data.processor) top.countries <- data.processor$top.countries international.countries <- unique(c(data.processor$top.countries, "China", "Japan", "Singapore", "Korea, South")) africa.countries <- sort(data.processor$countries$getCountries(division = "continent", name = "Africa"))
# Top 10 daily cases confirmed increment (data.processor$getData() %>% filter(date == current.date) %>% select(country, date, rate.inc.daily, confirmed.inc, confirmed, deaths, deaths.inc) %>% arrange(desc(confirmed.inc)) %>% filter(confirmed >=10))[1:10,]
# Top 10 daily deaths increment (data.processor$getData() %>% filter(date == current.date) %>% select(country, date, rate.inc.daily, confirmed.inc, confirmed, deaths, deaths.inc) %>% arrange(desc(deaths.inc)))[1:10,]
rg$ggplotTopCountriesStackedBarDailyInc(included.countries = africa.countries, countries.text = "Africa") rc$ggplotComparisonExponentialGrowth(included.countries = africa.countries, min.cases = 20) rg$ggplotCountriesLines(included.countries = africa.countries, countries.text = "Africa countries", field = "confirmed.inc", log.scale = TRUE) rc$ggplotComparisonExponentialGrowth(included.countries = africa.countries, field = "deaths", y.label = "deaths", min.cases = 1)
rg$ggplotTopCountriesStackedBarDailyInc(top.countries) rc$ggplotComparisonExponentialGrowth(included.countries = international.countries, min.cases = 100)
rg$ggplotCountriesLines(field = "confirmed.inc", log.scale = TRUE) rg$ggplotCountriesLines(field = "rate.inc.daily", log.scale = TRUE)
rg$ggplotTopCountriesPie() rg$ggplotTopCountriesBarPlots() rg$ggplotCountriesBarGraphs(selected.country = "Ethiopia")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.