COVID-19: WHO Status Reports

Introduction

This document records my efforts to work out displays for COVID-19 cases, based on status reports from the World Health Organization, as recorded in Edward Brown’s package data2019nCoV.

Installation and Setup

General tools we use:

Package data2019nCoV updates frequently, so you’ll want to check the Github repository for updates and re-install as needed:

The Data

We’ll work with WHO_SR:

Each row is a WHO situation report for a large number of countries (and some other groups such as health care providers).

Comparing a Few Countries

Our goal is to write functions that permit the user to view the number of confirmed cases over time, for selected countries.

Basic selection:

Try it out:

Each row is a small part of a WHO status report.

We will transform the data so that it is glyph-ready for a plot of the number of confirmed cases in each country against the date of the report. tidyr::gather() is our friend, here.

Note: It is very handy that gather() allows one to specify the columns to be gathered via a character-vector of the column names.

Very nice. But can we make the graph interactive?

Oops! The tooltip shows up fine, but the line plots are missing. I have googled this problem and found that (for reasons I don’t yet understand), you can get the lines if you use the group aesthetic, as follows:

Encapsulate in a Function

We can encapsulate our programming work into a function:

Try it out:

This works, but note that for some reason we lost the legend! Thankfully, the presence of the tooltip prevents this from being a big deal.

Where to Go From Here

  • Develop other analyses, e.g.:
    • display the data on a world map;
    • dig down into suspected cases, deaths, etc., to the extent provided by WHO_SR;
    • etc.
  • Shiny-fy our analysis.
  • Continue o study of plotly::ggplotly(), along with other interactive-graphics tools.

For more ideas consult the package vignettes:

Homer White, Georgetown College, KY

2020-03-16