Graphing My Daily Phone Use

How many times do I look at my phone? I set up a small program on my phone to count the screen activations and logged to a file. In this post I show what went wrong and how to plot the results. The data I set up a small program on my phone that counts every day how many times I use my phone (to be specific, it counts the times the screen has been activated). [Read More]

Logging my phone use with tasker

In this post I’ll show you how I logged my phone use with tasker, in a follow up post I’ll show you how I visualized that. I had a great vacation last week but relaxing in Spain I thought about my use of technology and became a bit concerned with how many times I actually look at my phone. But how many times a day do I actually look at my phone? [Read More]

Tweeting daily famous deaths from wikidata to twitter with R and docker

A tweet a day keeps the insanity at bay

In this explainer I walk you through the steps I took to create a twitter bot that tweets daily about people who died on that date. I created a script that queries wikidata, takes that information and creates a sentence. That sentence is then tweeted. For example: A tweet I literally just send out from the docker container I hope you are has excited as I am about this project. [Read More]

Use `purrr` to feed four cats

Replacing a for loop with purrr::map_*

Use purrr to feed four cats In this example we will show you how to go from a ‘for loop’ to purrr. Use this as a cheatsheet when you want to replace your for loops. Imagine having 4 cats. (like this one:) Four real cats who need food, care and love to live a happy life. They are starting to meow, so it’s time to feed them. Our real life algorithm would be: [Read More]

How to set up GNU Terry Pratchett on hugo with netlify

Keeping Terry Pratchett alive in static websites

TL;DR: In this post I will show you how to set up special header information on a static website such as hugo + netlify. Netlify interprets the _headers file and applies the rules to your website. You only have to set a simple rule, and now you too can keep Terry Pratchett alive! GNU Terry Pratchett On March 12th 2015 one of my favorite writers; Terry Pratchett died, but the people of the internet were not ready to let him go. [Read More]

Downloading files from a webserver, and failing.

Recently I wanted to download all the transcripts of a podcast (600+ episodes). The transcripts are simple txt files so in a way I am not even ‘web’-scraping but just reading in 600 or so text files which is not really a big deal. I thought. This post shows you where I went wrong Also here is a picture I found of scraping. Webscraping general For every download you ask the server for a file and it returns the file (this is also how you normally browse the web btw, your browser requests the pages). [Read More]

Writing manuscripts in Rstudio, easy citations

Intro and setup This is a simple explanation of how to write a manuscript in RStudio. Writing a manuscript in RStudio is not ideal, but it has gotten better over time. It is now relatively easy to add citations to documents in RStudio. **The goal is not think about formatting, and citations, but to write the manuscript and add citations on the fly with a nice visual help. ** This tutorial explains how to link Zotero (a reference manager) to your project folder and how to easily add citations. [Read More]

Plotting a map with ggplot2, color by tile

Introduction Last week I was playing with creating maps using R and GGPLOT2. As I was learning I realized information about creating maps in ggplot is scattered over the internet. So here I combine all that knowledge. So if something is absolutely wrong/ ridiculous / stupid / slightly off or not clear, contact me or open an issue on the github page. When you search for plotting examples you will often encounter the packages maps and mapdata. [Read More]

Submitting your first package to CRAN, my experience

I recently published my first R package to The Comprehensive R Archive Network (CRAN). It was very exciting and also quite easy. Let me walk you through my process. First a description of my brand new package: badgecreatr, then a description of steps to take for submission. Package description When you go around github looking at projects you often see these interesting images in the readme The ones you see above are from ggplot2. [Read More]

Your most valuable collaborator, future-you

I was recently at a R users meetup where Hadley Wickham talked about data wrangling. He showed some interesting stuff! Did you know that you can put a data frame into a data frame? You can make a list of data frames and add that list to your data frame. Very cool, and more useful then I thought, but that is not what I wanted to talk about. I would like to give you some tips about working with someone you will probably work with in the future. [Read More]