Information About Coronavirus Illness 2019 (COVID-19) in 5 Charts created with R and ggplot2

[This article was first published on novyden, and kindly contributed to R-bloggers]. (You may report challenge concerning the content material on this web page right here)

Wish to share your content material on R-bloggers? click on right here when you have a weblog, or right here in the event you do not.


Coronovirus pandemic is altering our way of life from day by day routine to near- and midterm plans, affecting relationships at house and work, adjusting our economical priorities and skills, making us reassess worth of products and companies, and arguably impacting all elements of life. Higher information and understanding of the decease, its manifestations and dynamics should play essential function in evaluation of present occasions and choices we make. Beneath I compiled some helpful information about COVID-19 into 5 charts and included dialogue of R and ggplot2 strategies used to create them.

On the finish of 2019, a novel coronavirus was recognized as the reason for a cluster of pneumonia circumstances in Wuhan, a metropolis within the Hubei Province of China. It quickly unfold, leading to an epidemic all through China, adopted by an growing variety of circumstances in different international locations all through the world. In February 2020, the World Well being Group designated the illness COVID-19, which stands for coronavirus illness 2019. The virus that causes COVID-19 is designated extreme acute respiratory syndrome coronavirus 2 (SARS-CoV-2); beforehand, it was known as 2019-nCoV.

Understanding of COVID-19 is evolving. This subject will talk about the epidemiology, scientific options, prognosis, administration, and prevention of COVID-19. 

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD

Although not all subjects above are coated on this weblog I reserve the precise to publish extra charts so keep tuned.

Medical Options


Incbuation Interval

The incubation interval for COVID-19 is regarded as inside 14 days following publicity, with most circumstances occurring roughly 4 to 5 days after publicity [29-31].

Utilizing knowledge from 181 publicly reported, confirmed circumstances in China with identifiable publicity, one modeling examine estimated that signs would develop in 2.5 p.c of contaminated people inside 2.2 days and in 97.5 p.c of contaminated people inside 11.5 days [32]. The median incubation interval on this examine was 5.1 days.

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD

Frequent method to show quartiles and excessive percentiles of steady distribution is with field plot. I selected towards it for couple of causes: a) analysis above had inadequate details about quartiles and b) field plots are much less recognized exterior of statistical neighborhood. As a substitute a gauge chart frequent in dashboard sorts of functions was used:

Implementation particulars in R


Dataset will maintain 6 rows with values corresponding to five percentiles – 0% (minimal), 2.5% and 97.5% (equivalent to 0.95 confidence interval), 50% (median), 100% (most) – and another for common:

Utilizing issue() will place gauges so as from least to biggest and extra column stext used to show a worth in readable format for every gauge.


First, let’s load packages used for plotting: ggplot2, ggthemes, and scales:

Realization of gauge charts utilizing ggplot2 I borrowed from this instance with a number of modifications defined subsequent:

Line by line explainer:

  • 2-4: put together rectangles for every worth . Every gauge is a pair of overlapping rectangles – one dispaying worth  geom_rect() with fixed one geom_rect(aes(ymax=14, ymin=0, xmax=2, xmin=1), fill =#ece8bd) as a background. 
  • 10: separate gauges by sides.
  • 5, 6: remodel coordinate system to polar, rotate it to start out at 9 pm and trim to show solely higher half of gauges.
  • 9 locations textual content label with worth in the course of every gauge.
  • 7, 8: coloration schema from few_pal()
  • 11: eradicating guides from the chart.
  • 12-15: title, subtitle, caption, and axis labels.
  • 16-19: customization utilizing ggthemes package deal and theme().


Sickness Severity

The spectrum of symptomatic an infection ranges from delicate to essential; most infections aren’t extreme [33,35-40]. Particularly, in a report from the Chinese language Heart for Illness Management and Prevention that included roughly 44,500 confirmed infections with an estimation of illness severity [41]:

  ● Delicate (no or delicate pneumonia) was reported in 81 p.c.

  ● Extreme illness (eg, with dyspnea, hypoxia, or >50 p.c lung involvement on imaging inside 24 to 48 hours) was reported in 14 p.c.

  ● Vital illness (eg, with respiratory failure, shock, or multiorgan dysfunction) was reported in 5 p.c.

  ● The general case fatality charge was 2.Three p.c; no deaths had been reported amongst noncritical circumstances.

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD

Apparent selection is a bar chart consisting of Four bars – Three for sickness severity specturm plus case fatality charge reported in the identical examine:

Implementation particulars in R


Dataset with Four rows and Four columns the place severity is a issue() ordered by p.c, percent_label used to show values above bars, and severity_label particulars sickness severity:


That is the case of easy bar chart utilizing geom_bar() with state=’identification’ enhanced simply with a few artifacts: geom_text() and annotate():

Line by line explainer:

  • 1-2: bar chart with stat=”identification” displaying Four bars.
  • 3: inserting p.c labels above bars.
  • 4: displaying y-axis labels in p.c format.
  • 5-6: coloration schema from few_pal() and customized labeling of the legend.
  • 7-8: textual content annotation about CFR in the course of the chart.
  • 9-12: title, subtitle, caption, and axis labels.
  • 13-17: customization utilizing ggthemes package deal and theme().


Medical Manifestations 

Pneumonia seems to be probably the most frequent critical manifestation of an infection, characterised primarily by fever, cough, dyspnea, and bilateral infiltrates on chest imaging [32,36-38]. There aren’t any particular scientific options that may but reliably distinguish COVID-19 from different viral respiratory infections.

In a examine describing 138 sufferers with COVID-19 pneumonia in Wuhan, the commonest scientific options on the onset of sickness had been [38]:

  ●Fever in 99 p.c

  ●Fatigue in 70 p.c

  ●Dry cough in 59 p.c

  ●Anorexia in 40 p.c

  ●Myalgias in 35 p.c

  ●Dyspnea in 31 p.c

  ●Sputum manufacturing in 27 p.c

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD

Persevering with utilizing bar chart to show scientific manifestations of COVID-19 on the onset of sickness:

Implementation Particulars in R


That is instance of a bar chart requiring a naked minimal of knowledge – simply 2 columns with identify and p.c to show 7 bars:


As soon as once more code under creates a bar chart utilizing stat = “identification”:

Line by Line explainer:

  • 1-2: bar chart with stat=”identification” displaying Four bars.
  • 3: displaying y-axis labels in p.c format.
  • 4: coloration schema from few_pal().
  • 5-8: title, subtitle, caption, and axis labels.
  • 9-12: customization utilizing ggthemes package deal and theme().


Case Fatality Price

In response to a joint World Well being Group (WHO)-China fact-finding mission, the case-fatality charge ranged from 5.Eight p.c in Wuhan to 0.7 p.c in the remainder of China [17]. A lot of the deadly circumstances occurred in sufferers with superior age or underlying medical comorbidities [20,41]. (See ‘Threat components for extreme sickness’ under.)

The proportion of extreme or deadly infections might fluctuate by location. For example, in Italy, 12 p.c of all detected COVID-19 circumstances and 16 p.c of all hospitalized sufferers had been admitted to the intensive care unit; the estimated case fatality charge was 7.2 p.c in mid-March [42,43]. In distinction, the estimated case fatality charge in mid-March in South Korea was 0.9 p.c [44]. This can be associated to distinct demographics of an infection; in Italy, the median age of sufferers with an infection was 64 years, whereas in Korea the median age was within the 40s.

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD

This chart shows CFR’s by age teams based mostly on 44672 confirmed circumstances in China via February 11 with total CFR = 2.3%:

Imlementation Particulars in R


The information consists of age, deaths, circumstances, and cfr computed as a ratio of final two:


This chart combines bar and line charts into single plot reflecting CFR charge dynamic over age teams and moreover displays measurement of those teams utilizing bar width:

Line by line explainer:

  • 1,2: line chart over CFR by age teams.
  • 3: horizontal dotted line representing total case fatality  charge.
  • 1,4: bar chart with stat=”identification” displaying CFR’s for every age group with adjusted bar width based mostly on variety of circumstances in every group.
  • 5,6: inserting textual content labels with express worth and calculation of CFR for every age group.
  • 7: displaying y-axis labels in p.c format.
  • 8: coloration schema from few_tаbleau().
  • 9-12: title, subtitle, caption, and axis labels.
  • 13-15: customization utilizing ggthemes package deal and theme().



Interval of infectivity

The interval throughout which a person with COVID-19 is infectious is unsure. Most knowledge informing this challenge are from research evaluating viral RNA detection from respiratory and different specimens. Nevertheless, detection of viral RNA doesn’t essentially point out the presence of infectious virus.

Viral RNA ranges seem like larger quickly after symptom onset in contrast with later within the sickness [18]; this raises the likelihood that transmission could be extra possible within the earlier stage of an infection, however extra knowledge are wanted to verify this speculation.

The period of viral shedding can be variable; there seems to be a variety, which can depend upon severity of sickness. In a single examine of 21 sufferers with delicate sickness (no hypoxia), 90 p.c had repeated detrimental viral RNA checks on nasopharyngeal swabs by 10 days after the onset of signs; checks had been constructive for longer in sufferers with extra extreme sickness [19]. In one other examine of 137 sufferers who survived COVID-19, the median period of viral RNA shedding from oropharyngeal specimens was 20 days (vary of Eight to 37 days) [20].

         Coronavirus illness 2019 (COVID-19) by Kenneth McIntosh, MD
This chart informs of minimal, median, and maxium period of viral shedding by contaminated people through the use of bars resembling time strains:


Imlementation Particulars in R


This chart will use bars to mimic time strains of interval of infectivity based mostly on analysis of how lengthy people shedded viral RNA that recognized minimal, median and most instances:


Yet one more instance of a bar chart with extra hack utilizing geom_point()‘s to show an improvised icon of SARS-CoV-2 virus:

Line by line explainer:

  • 1,2: bar chart with stat=”identification” displaying Three very skinny bars imitating time line. 
  • 3-6: overlaying Three completely different level shapes with various measurement to improvise virus icon
  • 7,8: textual content annotation concerning the distinction between being infectious and viral RNA shedding.
  • 9: flipping x and y axis to show time line horizontally.
  • 10-13: title, subtitle, caption, and axis labels. 
  • 14-16: customization utilizing ggthemes package deal and theme().


A lot of the information above are outcomes of extraordinarily younger analysis of COVID-16 that began simply little over Three months in the past. There are nonetheless many unknowns about each the virus SARS-CoV-2 and the desease. I compiled of few of them within the ultimate chart – some will appear stunning given the wealth of information science amassed about different deseases:


In case you bought this far, why not subscribe for updates from the location? Select your taste: e-mail, twitter, RSS, or fb

Leave a Reply

Your email address will not be published. Required fields are marked *