Code Monkey home page Code Monkey logo

corona_automated_charts's Introduction

Automate charts for the Covid-19 outbreak

Creates automated charts in Datawrapper for the spread of Covid-19.

Prerequisites

Installation

  • You will need a Datawrapper-API-Key (which is set as a constant in main.R). You can find more on that here.

Usage

You can run this scripts from your machine, or put it on a server which has R and all required packages installed (check out the needs-call in main.R to find them).

  • main.R contains all constants that need to be set beforehand. In the beginning of each function there is a chart_id which needs to be set to the correct Datawrapper-ID. This is quite a manual process but in ensures that there is always a correct mapping between script and chart.

  • You might want to set up a Cronjob to run every hour e.g.: 0 * * * * Rscript [PATH TO THE MAIN.R]/main.R >> log.txt (yes, there are a couple of logs written - just in case).


Dashboard

create_dashboard.R

We've created a dashboard for our website that shows the current case-count and calculated statistics on the doubling-speed and a trend indicator. You can find the live chart here.

Sources:


Maps

We currently only show maps of the German Federal States and Bavarian Counties. We deprecated a map of the whole world when there had been cases everywhere - it is now shown as a Datawrapper table with bar charts (see below).

Both scripts are called in get_geographical_data.R.

German Federal States

You can find the live map here.

map_german_states.R

Source:

  • our own research (combining sources like the RKI and state-level authorities in a Google Sheet)

Create a map of Bavarian counties

You can find the live map here.

map_bavaria_counties.R

This script maps the cases in Bavarian counties. It combines them with a translation table beforehand, to match county name with Lat and Lon-coordinates. Unfortunately the data source changes the names wildly each day (sometimes with a "Land"- or "Stadt"-suffix, sometimes without). So it needs a lot of manual correction.

Source:


Charts

Line chart of the cases

line_cases.R

Showing the cases in China and Worldwide over time. You can find the live chart here.

Sources:

Area chart comparing Cases, deaths and cured numbers

area_cases_vs_cured.R

Showing the cases, deaths and cured cum-sums over time. You can find the live chart here.

Source:

Table for all countries comparing Cases and deaths

table_world_cases_deaths.R

Showing the cases and deaths for each country in a sorted table. You can find the live chart here.

Sources:

Table for several countries comparing Cases and deaths

table_cases_deaths_recovered.R

Showing the cases, recovered and deaths only for China, Italy, Germany and the World right now in a table. You can find the live chart here.

Source:

Barchart: Death rates by Country

bar_deathrate.R

Trys to give a hint which country might be undertested, when deathrates (deaths/cases) exceed prior estimates heavily in some place. You can find the live chart here.

Source:

Linechart: Corona vs. SARS

line_corona_vs_sars.R

Comparing cases of the both. It was used often in the beginning, but right now other aspects emerged. You can find the live chart here.

Sources:


Contributors

corona_automated_charts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chlorenz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.