Publications by Martin Stefan

Conway's Game of Life

20.06.2020

In 1970, British mathematician John Horton Conway published the rules to a quite intriguing game called “The Game of Life”. The game consists of a grid of black and white cells. At the start of the game, a human player determines which of the cells are alive (= black) and which are dead (= white). In each subsequent round of the game, based o...

6723 sym R (5014 sym/11 pcs) 1 img

Professional Sports Betting with R?

15.06.2020

You probably all know about counting cards in Blackjack. Or at least you’ve heard about it. But did you know that you can do something very similar with sports betting? And R can be your accomplice. Of course, you won’t become a millionaire today, but here is a very fun exercise in R anyway. An unfair bet Suppose you offer a friend the follo...

8821 sym R (5254 sym/15 pcs) 4 img

Visualizing Twitterspheres

15.06.2020

In this quick tutorial you will learn how to visualize Twitter data. You will learn how to get access to Twitter’s API, how to retrieve tweets using rtweet, and how to study a Twitter user’s personal “Twittersphere”. The Twittersphere of Bernie Sanders In this figure you can see a network of all major hashtags used in tweets that also i...

5898 sym R (6579 sym/26 pcs) 3 img

Economics through the eyes of a satellite

08.08.2020

Nighttime satellite images are some of the most stunning photographs. Just have a look at the image below. What you see is a cloud-free composite of numerous individual satellite images taken in 2013. Together they not only produce a beautiful image of our planet, they also provide a great source of data. In this tutorial you will learn how you c...

6850 sym R (1893 sym/8 pcs) 9 img

Are U.S. Pesidential Speeches Getting Dumber?

26.06.2020

Some time ago, I came across a video on YouTube that detailed how the reading levels of U.S. presidential speeches declined over time. When reading up on this topic, I found that earlier analyses have come to same conclusion. Check out, for example, this article in “The Atlantic” or this blog post on “Towards Data Science”. The key result...

7290 sym R (12197 sym/24 pcs) 7 img

How to create a COVID-19 Dashboard in R

03.07.2020

By now you will be familiar with different dashboards that visualize the latest developments of the COVID-19 pandemic. The most famous coronavirus dashboard is arguable the dashboard created by Johns Hopkins University. But how can you build such a dashboard yourself? This tutorial will teach you how. We will use data from the EU Open Data Portal...

6489 sym R (6830 sym/16 pcs) 3 img

Regional strongholds of German automakers

28.07.2020

It’s no secret that Germany is known for its automotive industry. Cars are one of the country’s most important export and the German automotive industry employs hundreds of thousands of people. Interestingly, German car buyers exhibit a strong preference for cars build in their home region. Volkswagen (VW) cars, which are produced in the nort...

3220 sym R (9710 sym/10 pcs) 2 img

Using R to Find Strange Attractors

30.07.2020

In the image below you see four strange yet mesmerizing patterns. Some areas of these patterns are extremely bright, while others are rather dark. The bright areas seem to follow well-defined lines and curves. But these lines and curves don’t seem to follow any obvious logic like a circle or a spiral. The patterns have something “organic” a...

9881 sym R (4935 sym/9 pcs) 18 img

Using R to Simulate a Pandemic

30.08.2020

Since the outbreak of the COVID-19 pandemic policy makers and health experts have repeatedly stressed the importance of social distancing. This article in the Washington Post has done so using a series of simulations. In this post, you will learn how can run similar simulations using nothing but base R. In the animation below you can see how thes...

4819 sym R (6448 sym/16 pcs) 9 img

DIY Cryptography in Python

29.06.2020

In this tutorial you will learn about three ciphers and how you can implement these yourself in Python. The ciphers you will learn about are the Caesar cipher, the Polybius square and the Vigenère cipher. Of course none of these ciphers offer any kind of security in the modern age of computers. But for all of you interested in cryptography: Have...

6319 sym R (4869 sym/35 pcs) 1 img