<commit_before>---
layout: post
title: "Where to live in the Netherlands based on temperature XKCD style"
author: roel_hogervorst
modified: 
categories: blog
excerpt: After USA, Spain, France the summer and winter weather in the Netherlands was plotted. 
tags: [XKCD, weather, humidex, dplyr, ggplot2, readr, Netherlands]
image:
date: 2017-11-20
---

After seeing a plot of best places to live in Spain and the USA based on the weather, I had to 
chime in and do the same thing for the Netherlands. The idea is simple, determine where you want to live based on your temperature preferences.

First the end result:
![Netherlands, weatherplot XKCD style]({{ site.github.url }}/images/xkcd_NL_US_ESP.png)
 
How to read this plot?

In [this](https://xkcd.com/1916/) xkcd comic we see that the topleft of the the graph represents "if you hate cold and hate heat", if you go down from the topleft to the bottom left the winters get colder and ending in "if you love cold and hate heat". Going to the right the heat (and humidity) go up ending in "if you love cold and love heat". Going up to the top right: "if you hate cold and love heat". 

This post explains how to make the plot, to see  where I got the data and what procedures I took look at <https://github.com/RMHogervorst/xkcd_weather_cities_nl>.

### Inspiration

According to this [post by Ma<NAME>](http://www.masalmon.eu/2017/11/16/wheretoliveus/) inspired by xkcd, we can determine our ideal city by looking at wintertemperature and humidex (combination of humidity and summer heat).

I've seen major cities in the USA (post by Maelle) and where to live in Spain [by <NAME>](https://twitter.com/claudiaguirao/status/931615734521909248). There is even one on France [in French, of course](https://twitter.com/matamix/status/932283897018273792).

So I had to make one for the Netherlands too. There is just a small detail, 
The Netherlands is tiny, the United States is approximately 237 times larger then The Netherlands. From The Hague to the German border directly east is 164 km (101 miles) and from Leeuwarden to Maastricht in the south is 262 km (162 miles). Essentially my home country has a moderate sea climate with warm summers and relatively mild winters. 

I expect there to be no real big differences between the cities. I use the average temperature over december, januari and februari for winter temperature and calculate the humidex using the [comf package](https://cran.r-project.org/web/packages/comf/index.html). This humidex is a combination of humidity and temperature. 

-   20 to 29: Little to no discomfort
-   30 to 39: Some discomfort
-   40 to 45: Great discomfort; avoid exertion
-   Above 45: Dangerous; heat stroke quite possible

For cities I went the extremely lazy way and took all of the available weatherstations provided by the Dutch weather service (KNMI, --- Royal Netherlands, Metereological Institute). There are 46 stations in the Netherlands. These are not always in the cities but sort of broadly describe the entire country.
 
### Plot like XKCD
The XKCD package has wonderful plotting abilities and a cool font that you have to install. I copied and modified the code from the post of Mäelle, because it is really good!

If you want to see how I did the data cleaning go to the [github page](https://github.com/RMHogervorst/xkcd_weather_cities_nl). <commit_msg>update blog xkcd january february not with an i<commit_after>---
layout: post
title: "Where to live in the Netherlands based on temperature XKCD style"
author: roel_hogervorst
modified: 
categories: blog
excerpt: After USA, Spain, France the summer and winter weather in the Netherlands was plotted. 
tags: [XKCD, weather, humidex, dplyr, ggplot2, readr, Netherlands]
image:
date: 2017-11-20
---

After seeing a plot of best places to live in Spain and the USA based on the weather, I had to 
chime in and do the same thing for the Netherlands. The idea is simple, determine where you want to live based on your temperature preferences.

First the end result:
![Netherlands, weatherplot XKCD style]({{ site.github.url }}/images/xkcd_NL_US_ESP.png)
 
How to read this plot?

In [this](https://xkcd.com/1916/) xkcd comic we see that the topleft of the the graph represents "if you hate cold and hate heat", if you go down from the topleft to the bottom left the winters get colder and ending in "if you love cold and hate heat". Going to the right the heat (and humidity) go up ending in "if you love cold and love heat". Going up to the top right: "if you hate cold and love heat". 

This post explains how to make the plot, to see  where I got the data and what procedures I took look at <https://github.com/RMHogervorst/xkcd_weather_cities_nl>.

### Inspiration

According to this [post by <NAME>](http://www.masalmon.eu/2017/11/16/wheretoliveus/) inspired by xkcd, we can determine our ideal city by looking at wintertemperature and humidex (combination of humidity and summer heat).

I've seen major cities in the USA (post by Maelle) and where to live in Spain [by <NAME>](https://twitter.com/claudiaguirao/status/931615734521909248). There is even one on France [in French, of course](https://twitter.com/matamix/status/932283897018273792).

So I had to make one for the Netherlands too. There is just a small detail, 
The Netherlands is tiny, the United States is approximately 237 times larger then The Netherlands. From The Hague to the German border directly east is 164 km (101 miles) and from Leeuwarden to Maastricht in the south is 262 km (162 miles). Essentially my home country has a moderate sea climate with warm summers and relatively mild winters. 

I expect there to be no real big differences between the cities. I use the average temperature over december, january and february for winter temperature and calculate the humidex using the [comf package](https://cran.r-project.org/web/packages/comf/index.html). This humidex is a combination of humidity and temperature. 

-   20 to 29: Little to no discomfort
-   30 to 39: Some discomfort
-   40 to 45: Great discomfort; avoid exertion
-   Above 45: Dangerous; heat stroke quite possible

For cities I went the extremely lazy way and took all of the available weatherstations provided by the Dutch weather service (KNMI, --- Royal Netherlands, Metereological Institute). There are 46 stations in the Netherlands. These are not always in the cities but sort of broadly describe the entire country.
 
### Plot like XKCD
The XKCD package has wonderful plotting abilities and a cool font that you have to install. I copied and modified the code from the post of Mäelle, because it is really good!

If you want to see how I did the data cleaning go to the [github page](https://github.com/RMHogervorst/xkcd_weather_cities_nl). 
{'fraction_non_alphanumeric': 0.0615748963883955, 'fraction_numerical': 0.02605091770278271, 'mean_word_length': 4.299607843137255, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3867251', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1838, 'n_words': 1018}