How to Get Daily COVID-19 Data using R

Getting numbers about the pandemic is not as hard as you think!

Josh Gonzales, PhD(c)
R Tutorials

--

Photo by Dimitri Karastelev on Unsplash

Yes, the pandemic sucks. But as someone who looks at data for a living, there are at least opportunities for growth, even in the worst of times!

One way you can grow as a data scientist is to look at the ways infection rates affect other related variables (just be sure to take a removed analytical approach, as putting emotion into this can be… less than ideal).

To begin, just install the covid19.analytics package made my Marcelo Ponce and Amit Sandhel using the following command:

install.packages("covid19.analytics")

Then all you have to do is load the library using:

library(covid19.analytics)

After you’ve installed the package, you can start to play around with a bunch of functions that the coders built into the library. I’m going to start you off with two of the main ones.

covid19.data( )

This function looks at the current day’s COVID-19 information from John Hopkins Coronavirus Resource Center. Just load the data into a data frame:

df <- covid19.data()

--

--

Josh Gonzales, PhD(c)
R Tutorials

PhD Candidate @ University of Guelph studying representation in entertainment and goal-oriented decision-making