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]

Reading in an epub (ebook) file with the pubcrawl package

In this tutorial I show how to read in a epub file (f.i. from your ebook collection on you computer) into R with the pubcrawl package. In emoji speak: 🍺📖📦 . I will show the reading in part, (one line of code) and some other actions you might want to perform on textfiles before they are ready for text analysis. After you read in your epub file you can do some cool analyses on it, but that is part of the next blogpost. [Read More]

Cleaning up and combining data, a dataset for practice

tldr: I created an open dataset for the explicit practice of data munging. Feel free to use it in assignments, but do mention where you got it from (CC-by-4.0). Also unicorns are awesome. Find the dataset at: https://github.com/RMHogervorst/unicorns_on_unicycles Data munging / cleaning / engineering At work I was working with a two excel files that were slightly different but could be combined into 1 dataset. This is very typical for day to day cleaning operations that analysts and data scientists do (statisticians too). [Read More]

Adding logging to a shiny app with loggit

This is a very short post with example code Over time when you move your shiny app from your computer to a server, you want to add some logging. Generally logging is defined in levels : INFO (everything you want to print), WARNING (it does not stop the application, but it could be a problem), and ERROR (fatal things). Shiny server does already log all it’s actions to a file on the server, but that file can be hard to access. [Read More]

Setting up a version controlled shiny-server

Last week I set up a shiny server, it was relatively easy! But I wanted something more, a way to make changes on my local computer and push it to the server. Shiny server (I used the open source version) has multiple installers provided by RStudio. The installers for shiny-server create a user shiny and installs all the services needed. I used a guide specific for my version of linux to install shiny-server and combined it with two other guides to make it version controlled. [Read More]

Moving parts of a country over a map

I love making maps, I also love making gifs. In this short post I make an animated gif of parts of a map moving. In this case the parts of the map only move in the xy direction, but you can also turn them, and make them bigger or smaller. Today I show you how I made a part of the Netherlands ‘float away’. It is part of a larger nonsense project (I have many silly projects), and mostly just to document my path to learning about spatial analytics. [Read More]

add abbreviations to your rmarkdown doc

Today a small tip for when you write rmarkdown documents. Add a chunk on top with abbreviations. in the first chunks you set the options and load the packages. Next create abbreviations, you don’t have to care about the ordering, just put them down as you realize you are creating them. The first step makes a dataframe (a tibble, rowwise), and the second step orders them. tribble( ~Abbreviation, ~ Explanation, "CIA", "Central Intelligence Agency", "dplyr", "data. [Read More]

Adding bananas from the commandline (extending the oomsifier)

Sometimes you just want to add bananas from the commandline. Previously I created a small script that takes an image and adds a dancing banana to the bottom left of the image. I wanted to make an API too, but that will have to wait till next year. Today we will create a commandline script that will do the same thing. With the excellent explanation in Mark Sellors’ guide I have now created a cmdline thingy in very few steps. [Read More]

If blogging was like academia, we would all be saved, thank you for your edits.

A month ago I posted a short piece inspired by a post by Maële Salmon She actually reached out to me in 10 minutes, telling me I made a weird spelling error (no excuses, I really make those a lot). Then a day or two later Jon Spring walked through the code and realized that I switched two outcomes in the code. Just about 10 days ago I posted about downloading multiple files and Mara Avarick noticed a weird ‘<<<<<<’ sign on my website. [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]