How to create a simple Coronavirus dashboard specific to your country in R
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
![](https://i1.wp.com/statsandr.com/blog/2020-03-23-how-to-create-a-simple-coronavirus-dashboard-specific-to-your-country-in-r_files/How%20to%20create%20a%20simple%20Coronavirus%20dashboard%20specific%20to%20your%20country%20in%20R-1.png?w=578&ssl=1)
Coronavirus dashboard: the case of Belgium
Introduction
The Novel COVID-19 Coronavirus is the hottest topic right now. Every day, the media and newspapers share the number of new cases and deaths in several countries, try to measure the impacts of the virus on citizens and remind us to stay home in order to stay safe. The Coronavirus is on everyone’s lips.
In addition to governments, media and companies discussing about it, data scientists and data professionals in general are putting their knowledge and time at the service of the virus. This leads to a proliferation of applications, dashboards, blog posts, videos, datasets and code analyzing, in one way or another, the expansion of the COVID-19 and how it spreads in the population.
Additional notes
Data
The input data for this dashboard is the dataset available from the {coronavirus}
R package. Make sure to download the development version of the package to have the latest data:
install.packages("devtools") devtools::install_github("RamiKrispin/coronavirus")
To update your dashboard with the latest data, you have to manually update the data by reinstalling the {coronavirus}
package with devtools::install_github("RamiKrispin/coronavirus", force = TRUE)
. Again, if R asks you whether you would like to update other packages, type 3 for “None”.
This question was often raised so I repeat, your dashboard will not update by itself every day, you need to manually update it. After updating the data, you may also need to restart your R session in order to have the last available data.
The raw data is pulled from the Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) Coronavirus repository.
Open source
This dashboard and the code available on GitHub are open source so feel free to copy it, adapt it and share it as much as you want.
Accuracy
Please note that this dashboard has been built mainly for educational purposes. I update the dashboard as often as possible to keep it accurate. However, there is some uncertainty concerning the COVID-19 case numbers and the testing methods vary between countries so the figures on this dashboard may be slightly different compared to other sources. Currently, the maintainer of the dataset updates it on a daily basis, but updates may become less frequent in the future.
Publish your dashboard
If you want to share your dashboard, you can either:
- Upload it on your website if you have one (and I strongly suggest you to create one if you do not already have one)
- Publish it through RPubs (it is free and easy to publish your work directly from RStudio)
Thanks for reading. I hope this article helped you to build your first Coronavirus dashboard in R. See these top R resources on Coronavirus if you need inspiration to enhance further your dashboard.
As always, if you have a question or a suggestion related to the topic covered in this article, please add it as a comment so other readers can benefit from the discussion.
I would be glad to mention a collection of Python resources if someone is willing to create a collection of resources about the Coronavirus made with this programming language. Feel free to contact me if this is the case.↩︎
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.