Replicating a New York Times Table of Swedish COVID-19 deaths with gt - Table Contest Submission

Replicating a New York Times Table of Swedish COVID-19 deaths with gt

Authors: Malcolm Barrett
Affiliations: Livongo Health

Abstract: In this blog post, I describe how to replicate a table from the New York Times (NYT) in gt. The inspiration for this post comes from an NYT article on Sweden's herd immunity strategy for COVID-19 and the resulting excess mortality. In the NYT article, the authors present a table of excess deaths for Sweden and other countries in Europe. I thought this table was remarkably good: it’s simple, clear, and beautiful. The tutorial shows how you can make the same sort of table in gt.

Full Description:


Table Type: static-HTML
Submission Type: Tutorial
Table: https://malco.io/2020/05/16/replicating-an-nyt-table-of-swedish-covid-deaths-with-gt/
Repo: https://github.com/malcolmbarrett/malco.io/blob/master/content/post/2020-05-16-replicating-an-nyt-table-of-swedish-covid-deaths-with-gt/index.Rmd
RStudio Cloud:
DT package used:
gt package used: true
reactable package used:
flextable package used:
huxtable package used:
kableExtra package used:
Other packages:

2 Likes

This is nicely done!

Random question: do you happen to know what data visualizations tools/technologies are used by NYT? I have read in various places that R is one of tools that they use. Their tables and charts all have a very unique NYT feel, so clearly they are not applying anything "off-the-shelf"...guessing lots of customizations.

From the article, their choropleth map at the beginning and the line-with-circles near the end are very effective bits of data viz as well.

Many visualizations you see from the NYT are developed with D3.js created by Mike Bostock. There is also an R wrapper for the library: https://rstudio.github.io/r2d3/.

D3.js is not easy to learn though.