When’s the case for case_when() ?

When's the case for case_when() ?
Last week I was taking some colleagues through the code for my COVID19 PDF scraping and afterwards one sent me a message asking about a chunk of code that used the dplyr::case_when() function. In particular they wanted to know why case_when() uses the tilde (~)1, which led to a bit more of a generalised conversation about case_when() and how it works. In your script, when you assign the values to the entity and position columns inside your case_when() call why do you use ~ rather than = or <-?
Read more →

Automating the COVID19 PDF scraping

In my last post I wrote about the process for scraping data from Google’s COVID-19 Community Mobility Reports. That post dealt with processing just one report, the one for the UK, but Google have published reports for around 130 countries and one for each of the 50 US states. So we could run the script 180 separate times to extract all the data, but we can easily extend our scripting to automate this process.
Read more →

Scraping Google’s COVID-19 mobility report PDFs

Scraping Google's COVID-19 mobility report PDFs
Last week Google published their COVID-19 Community Mobility Reports. These make use of Google’s very extensive location history data, which they mainly use for telling you about traffic levels on roads, popular times for places in Google Maps and whether a bar or restaurant is busier than usual. In these mobility reports they’ve looked at the location history data for a large number of countries, and localities within countries to help public health officials review the effectiveness of social distancing measures.
Read more →

Hello

Hello
Well hello, you! I’m Matt, and this is the first post. I’m not entirely sure how this will turn out, I tried to blog when I was in my early-twenties but that didn’t go very far and is now buried in the digital dust (thankfully). But I’ve been inspired by Matt Dray’s recent post “Dear past self: blog” to start blogging, in particular his idea that his blog is his reference library.
Read more →