Click on the links below to jump straight to the file format of your interest. 
 
 GeoJSON 
 Shapefile 
 GeoPackage 
 Geodatabase 
 
 In a previous post I mentioned that I ocassionally create maps using the GeoJSON format, but that for simple maps that need to be done quickly I’d use the {csmaps} package which contains some neatly packaged maps in an easy to use…

 A little while ago I scrolled past a post on BlueSky commenting on a discussion where political scientist Oscar Pocasangre pulled up some figures he created on the topic of discussion a while ago. The figures he pulled up were for a 2023 report he co-wrote for think tank New America . While the topic in itself is interesting 
 
 
 It’s about partisan divide in the 2022…

 Reveal.js is awesome and in this post I’ll explain why. If you have never heard of it, reveal.js is an open source tool to create presentations (slide decks if you prefer). While it does have a GUI wrapper by the same developer Hakim El Hattab ( sponsor link ), I have been using the HTML/CSS framework to build mine, and I love it. Before I dive I’ll have to mention that I know…

 Throughout my career so far I’ve been lucky to work with many different types of data. It’s exciting how all different kinds of data can be represented and interpreted by different programming languages 1 . So today I’m going to do another one of these and dive into analyzing data from satellite images. Learning to parse data from freely available satellite imagery is both…

 
 I’ve wandered around the data viz community for a while now, and it tends to be same set of news agencies, organisations, and individuals that are shared and discussed repeatedly for their ingenuity, creativity, or just excellent execution. Some of my sources of inspiration are (among others), Axios (with for example Will Chase ), the New York Times , and the (now defunct)…

 Energy production 
 Weather and climate data 
 Length of day 
 Energy storage and prices 
 
 One of the main reasons I maintain this blog is because I like delving into methods and topics that I don’t get the chance to during my day job. One of those topics is the energy market. As energy markets move towards more sustainable sources of production, there are some…

 I’m very about what I share on the internet. Strava stores a bunch of data I am not comfortable sharing openly on the internet. Now, I think my health (and the summarized data below does hopefully reflect that too) is excellent, but it’s just a word of caution to everyone who might think about working/analyzing this type of data. If you share your segments publicly, it is fairly…
One of the most well-known issues with LLMs is the phenomenon of “hallucinations”, where it makes up facts and presents them confidently as true. It’s one of the main challenges of using LLMs in corporations, since improper validation by the user may result in people drawing conclusions based on flawed information (like this famous example, and this one ). If it wasn’t…
Notebooks are a cornerstone of exploratory data analysis in data science (and sometimes also in production for some godforgiven reason?). Notebooks get a fair share of (justified) criticism , but I believe they are useful if used right, particularly in the education sphere where you can get immediate feedback on the code you wrote. The best-known notebook platforms are Jupyter for Python (although…

 Introduction 
 How Science Works 
 The Article Processing Fee 
 Profit Margins 
 Lobbying 
 What Can Universities Do? 
 So What Do We Do Next? 
 FAQ 
 En español 
 
 Introduction 
 Recently the last article of my PhD was published. The article ended up in a scientific journal called Nature Mental Health and is available online here . Now, unless…
So I’ve recently become the proud owner of a Raspberry Pi 5 , a microcomputer that fits in the palm of your hand. Its initial stated use was for educational purposes in computer science, but it’s since been widely adopted by hobbyists with varying interests. I got mine to use with some data science projects, educational projects, and to host a variety of apps that currently live on…

 This post is about the 2023 Dutch parliamentary elections, not the 2024 European parliament elections or the 2025 Dutch parliamentary elections
 
 So it’s time again for the Netherlands to have another election for the Dutch parliament ( Tweede Kamer ) The previous one was only in 2021, and we had elections in 2023 already for the Provinces and indirectly for the Dutch…
Using an API (an application programming interface ) is a very popular tool for data scientists to pull data from a public source. I’ve done a bit of web scraping in previous blogposts where I collected data from for example Wikipedia and the Olympian Database . However, I’d much prefer using APIs whenever possible, this way the creator has more control of what data they want to share…
Today I want to share a project that deals with data scientist’s favorite kind of data: date- and timedata involving time zones and daylight savings time. Who doesn’t love it? 
 This project stems from a discussion I had with my family about living up north in Norway and when the days become longer than in the Netherlands. Intuitively, one might think that because of the prevailing…
Let’s imagine you’re incredibly lazy and you want to learn R, but you only want to learn one function to do statistics. What function do you learn? I’d recommend to learn to use the lm() function. Why? Because most common statistical tests are in fact nothing more than some variation of a linear model, from the simplest One-Sample T-test to a repeated-measures ANOVA. I think most…
The 2022 Winter Olympics started last week. I’m don’t usually follow sports (of any kind) religiously during a regular year, but I make an exception for the Winter Olympics. In particular the speed skating events I’ll watch live as much as time allows me. It’s no secret the Netherlands is a speed skating nation ( although some international TV commentators don’t quite…
This is just a very quick blog post outlining some of the commonalities and differences between factor analysis (FA), principal component analysis (PCA), and independent component analysis (ICA). I was inspired to write some of this down through some confusion caused in the lab by SPSS’ apparent dual usage of the term “factor analysis” and “principal components”. A…

 
 As of March 2023 {fhimaps} and {splmaps} are no longer supported due to budget cuts at the institution supporting them. The amazing developers (led by Richard Aubrey White and Chi Zhang ) have moved the data and functionality to a new package called {csmaps} . The code below is updated to reflect the changes.
 
 Every now and then you discover a discover a much simpler solution…

 
 For this post, I decided to hide the code chunks by default to improve legibility. You can click on Show code to expand the code.
 
 Introduction 
 I’m at the age where a lot of my peers start thinking about buying a home. It is a major conversation topic around the office, and these conversations are not often filled with optimism and excitement. Oslo is a…
Introduction 
 If there was a statistics magazine and it were to have ads, the ad for independent component analysis (commonly referred to as the ICA) might read something like this: 
 
 Do you ever find yourself with a large number of highly related variables? Are you interested in studying constructs rather than specific measures? Would you rather work with a small number of…

 
 Introduction 
 Most people in my environment know R as the quintessential tool for statistical analysis and data visualization. There’s plenty of tutorials and discussions online about how to go about either. But one important aspect that is noticeably lacking is a discussion about R’s ability to simulate scenes from Star Wars. Today, we’ll set this straight. At…
Introduction 
 Whenever I show my colleagues in the genetics group my results, the first things they say are “ can you show me the Manhattan plots? ” and “ can you show me the QQ plots? ”. I covered how to make Manhattan plots in ggplot before (click here ) for a link. But now I want to go through how I make QQ plots. I’m aware that there’s a number of…

 Introduction 
 A little while ago I was watching a documentary series on Dutch television about one of the most important composers in the Netherlands: Johann Sebastian Bach. The documentary discussed parts of Bach’s life and the music he wrote during it. This documentary inspired me to learn more about the pieces Bach wrote, and since this is my life now, I might as well do it in…
Introduction 
 There are many ways to create a Manhattan plot. There’s a number of online tools that create Manhattan plots for you, it’s implemented in a number of toolboxes that are often used in genetics, and there’s a couple of packages for R that can create these plots. However, these options often don’t offer the customizability that some people (like me) would…
Introduction 
 Plotting ERPs is one of the essential skills in EEG neuroscience. There are many possible ways of going about this task, some better than others. Myself, I use either MATLAB or R to plot ERPs. In my experience, MATLAB is by far the preferred method since most of the EEG analysis takes place in MATLAB already, but I believe that there’s some merit to using R. One of my main…
Hi, I’m Daniel Roelfs. 
 
 
I’m currently working as a Data Scientist at the Norwegian bank DNB. Prior to this I was a PhD candidate working at the Norwegian Centre for Mental Disorders Research (NORMENT) in Oslo. My doctoral research focused on the intersection between neuroimaging and genetics to discover more about the human brain and the biology underlying psychiatric…

 Selection of publications. For a full list see my Google Scholar profile 
 2026 
 
 
 T Moberget, D van der Meer, S Bahrami, D Roelfs , O Frei, T Kaufmann, S Fernandez-Cabello, M Kim, T Wolfers, J Diedrichsen, OB Smeland, A Shadrin, A Dale, OA Andreassen, LT Westlye The genetic architecture of human cerebellar morphology supports a key role for the cerebellum in human…