Learn R Programming

⚠️There's a newer version (3.0.3) of this package.Take me there.

Coronavirus COVID-19 (2019-nCoV) Data Acquisition and Visualization

Pre-processed, ready-to-use, tidy format datasets of the 2019 Novel Coronavirus COVID-19 (2019-nCoV) epidemic. The latest data are downloaded in real-time, processed and merged with demographic indicators from several trusted sources. The package implements advanced data visualization across the space and time dimensions by means of animated mapping. Besides worldwide data, the package includes granular data for Italy, Switzerland and the Diamond Princess.

fielddescription
idid in the form "country|state|city"
datedate
countryadministrative area level 1
stateadministrative area level 2
cityadministrative area level 3
latlatitude
lnglongitude
deathsthe number of deaths
confirmedthe number of cases
teststhe number of tests
deaths_newdaily increase in the number of deaths
confirmed_newdaily increase in the number of cases
tests_newdaily increase in the number of tests
poptotal population
pop_14population ages 0-14 (% of total population)
pop_15_64population ages 15-64 (% of total population)
pop_65population ages 65+ (% of total population)
pop_agemedian age of population
pop_densitypopulation density per km2
pop_death_ratepopulation mortality rate

Quickstart

# Install COVID19
install.packages("COVID19")

# Load COVID19
require("COVID19")

Data Acquisition

# Diamond Princess
d1 <- diamond()

# Global data
w1 <- world("country")       # by country
w2 <- world("state")         # by state

# Swiss data
s1 <- switzerland("country") # by country
s2 <- switzerland("state")   # by canton

# Italian data
i1 <- italy("country")       # by country 
i2 <- italy("state")         # by region 
i3 <- italy("city")          # by city

Data Visualization

geomap(w2, 
  map = "world", 
  value = "confirmed_new",
  legend.title = "Daily Cases",
  caption = "Data source: JHU CSSE",
  nframes = 30+(2*length(unique(w2$date))),
  end_pause = 30)

Data Sources

COVID-19Demographics
WorldJohns Hopkins University Center for Systems Science and Engineering (JHU CSSE)World Bank Open Data, World Factbook by CIA.
ItalyMinistero della Salute, Dipartimento della Protezione CivileIstituto Nazionale di Statistica
SwitzerlandRepository collecting the data published on the cantonal websitesSwiss Federal Statistical Office
Diamond PrincessJohns Hopkins University Center for Systems Science and Engineering (JHU CSSE), WikipediaWikipedia

Copy Link

Version

Install

install.packages('COVID19')

Monthly Downloads

737

Version

0.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Emanuele Guidotti

Last Published

March 31st, 2020

Functions in COVID19 (0.2.1)

WB

Demographic indicators - Global
world

Coronavirus COVID-19 data - Global
diamond

Coronavirus COVID-19 data - Diamond Princess
geomap

Animated Mapping
gapply

Apply a function to each group
italy

Coronavirus COVID-19 data - Italy
IT

Demographic indicators - Italy
switzerland

Coronavirus COVID-19 data - Switzerland
CH

Demographic indicators - Switzerland