The coronavirus package in R
The coronavirus package provides a tidy format dataset of the 2019 Novel Coronavirus COVID-19 (2019-nCoV) epidemic. The raw data pulled from the Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) Coronavirus repository.
First, we run in the package, which includes a dataset called “coronavirus” that is updated daily.
This coronavirus dataset has the following fields: date - The date of the summary province - The province or state, when applicable country - The country or region name lat - Latitude point long - Longitude point type - the type of case (i.e., confirmed, death) cases - the number of daily cases (corresponding to the case type)
We print out the tail to see that the last observations are from today.
| date | province | country | lat | long | type | cases | |
|---|---|---|---|---|---|---|---|
| 126380 | 2020-06-25 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
| 126381 | 2020-06-26 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
| 126382 | 2020-06-27 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
| 126383 | 2020-06-28 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
| 126384 | 2020-06-29 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
| 126385 | 2020-06-30 | Zhejiang | China | 29.1832 | 120.0934 | recovered | 0 |
Which countries have the highest case count today?
| country | total_cases |
|---|---|
| US | 2635417 |
| Brazil | 1402041 |
| Russia | 646929 |
| India | 585481 |
| United Kingdom | 314160 |
| Peru | 285213 |
| Chile | 279393 |
| Spain | 249271 |
| Italy | 240578 |
| Iran | 227662 |
| Mexico | 226089 |
| Pakistan | 213470 |
| France | 202063 |
| Turkey | 199906 |
| Germany | 195418 |
| Saudi Arabia | 190823 |
| South Africa | 151209 |
| Bangladesh | 145483 |
| Canada | 106097 |
| Qatar | 96088 |
This chart and corresponding graph shows that the majority of cases are currently active, and shows the sliver of data on deaths. However, the reliability and usefulness of this data is limited.
| country | confirmed | death | recovered |
|---|---|---|---|
| US | 44766 | 1277 | 15428 |
| Brazil | 33846 | 1280 | 30507 |
| India | 18641 | 507 | 13090 |
| South Africa | 6945 | 128 | 2929 |
| Russia | 6683 | 154 | 9195 |
| Mexico | 5432 | 648 | 4391 |
| Saudi Arabia | 4387 | 50 | 3648 |
| Pakistan | 4133 | 91 | 2299 |
| Bangladesh | 3682 | 64 | 1844 |
| Chile | 3394 | 113 | 5075 |
| Colombia | 3274 | 120 | 1676 |
| Peru | 2848 | 173 | 3376 |
| Iran | 2457 | 147 | 2578 |
| Argentina | 2262 | 27 | 890 |
| Iraq | 1958 | 104 | 1786 |
| Egypt | 1557 | 81 | 509 |
| Indonesia | 1293 | 71 | 1006 |
| Turkey | 1293 | 16 | 1302 |
| Bolivia | 1094 | 52 | 412 |
| Philippines | 1076 | 11 | 277 |
This chart is made in plotly, so provides us the ability to hover over a square to see more information about that country. It visually shows the distribution of Covid cases worldwide.
Using data from the New York Times via Github, and the package “covid19nytimes”, we can make this map and update it daily.