Francis Windram @franwin.co.uk · 09/01/2026Oh that's a fantastic idea! Honestly shapefiles have always annoyed me, but I don't do enough with them to have done a deep dive into alternative formats. Already implemented and this saved me 25% storage size and ~35% load time for the largest files! Thank you so much! 100
Francis Windram @franwin.co.uk · 08/01/2026I definitely agree, devs should strive to inform the user when caches are created (and, better yet, used). In the end it is a little tricky if your code is only ever run once, because after that you have no ability to affect the user's system in any meaningful manner. But still...let them know! 110
Francis Windram @franwin.co.uk · 13/05/2025103-105 are pretty dire. Specifically asylum is an internationally protected obligation of a state. There is little reason to claim asylum when you are already living legally in a country, that doesn't mean that you would be safe if you went back home then. Would you claim asylum if you had ILR? 110
Francis Windram @franwin.co.uk · 13/05/2025Point 102 misses a fundamental lag component of this data. Undergraduate degrees in the UK are usually 3 years long, Master's degrees are usually 1 year. Thus the 2024 data is a lagged combination of 2023 and 2021 visa entries. We will not see the effects of changes made for another few years. 110
Francis Windram @franwin.co.uk · 13/05/2025In 100. the authors unintentionally spell out the reasoning for these increased visa numbers: uncapped master's degree tuition fees (see above). They also cynically fail to acknowledge the ~85% fall in dependants between 2023 and 2024. Point 101 is a nothingburger and I won't waste your time. 210
Francis Windram @franwin.co.uk · 13/05/2025In 99. the government fails to address the underlying drive of the International Education Strategy, which was to try to prop up a reduction in real-terms spending on higher education by the government with uncapped fees paid by international students. This is highlighted further in point 100. 110
Francis Windram @franwin.co.uk · 13/05/2025In 98, the government deliberately and specifically fails to mention the distinct fall in student visas issued in 2024 (down by 100,000 from the peak in 2023). Also this graph commits the sin of having two y axes in different units at different scales. Whoever created this plot should be ashamed. 110
Francis Windram @franwin.co.uk · 20/03/2025If you add call=rlang::caller_env(n) where n is the stack frame you want to report, you can get a much more useful error message. Here we can see that it was the div() function that threw our error! 111
Francis Windram @franwin.co.uk · 20/03/2025If you're catching errors in #rstats and stopping using tryCatch and cli_abort (or rlang::abort), you may encounter something like this "Error in `value[[3L]]()`". This isn't helpful for finding where something went wrong, you don't know what actually threw the error. But there's an easy fix! 220
Francis Windram @franwin.co.uk · 19/03/2025It'll also happily handle rolling summaries, such as a rolling weekly mean! 020
Francis Windram @franwin.co.uk · 19/03/2025Recently I've been playing with the "slider" package for sliding windows #rstats It's exceedingly useful for generating aggregated summaries over a dataset (i.e. weekly means) 162
Francis Windram @franwin.co.uk · 05/03/20258/ Plotting is absolutely not the only time you may wish to use the data pronoun! You will also definitely encounter it if using dplyr to create a package (R CMD CHECK I'm looking at you...). It is, however, a very useful example. 020
Francis Windram @franwin.co.uk · 05/03/20256/ Armed with this knowledge we can create a super simple for loop around some generic plotting code to plot each variable we care about. 130
Francis Windram @franwin.co.uk · 05/03/20255/ This is where the .data pronoun steps in. It allows you to indirectly (or directly) access the data of a piped dataframe to use in further function calls. To do this you will often write something like `.data[[var]]` So to steal from the dplyr documentation we could do something like this: 120
Francis Windram @franwin.co.uk · 05/03/20254/ But we immediately hit a problem! How do we pass an arbitrary set of column names to the aesthetic argument of your geoms? We can define the column names as a vector of strings, but aes doesn't take strings as arguments. (so you can't do aes(x="mycolumn")). 120
Francis Windram @franwin.co.uk · 05/03/20252/ Often when writing something like ggplot plotting code you may want to plot a set of different variables from a data frame. Sometimes it will make sense to include these on the same graph, but in others your really want them on an axis. 120
Francis Windram @franwin.co.uk · 05/03/2025🧵 Now it's time for another R thread. So let's talk about the .data pronoun from rlang/dplyr. #R #dplyr #rlang 142
Francis Windram @franwin.co.uk · 17/01/202513/ My PhD research mostly focused on creating new methods and metrics for analysing the physical structure of spider webs, so in coming threads I am sure I will talk more about the traits of webs and their function for the spider's foraging. More spider facts coming soon! 030
Francis Windram @franwin.co.uk · 17/01/202512/ Spiders will often weave webs in places where they have a natural "frame", and also some seem to prefer to be near light sources as those attract prey. 110
Francis Windram @franwin.co.uk · 17/01/202511/ The final major structure within an orb web is the frame. This is made of fairly strong silk (similar to the radial lines) and attach to the surrounding environment to anchor the web in place. 110
Francis Windram @franwin.co.uk · 17/01/202510/ The radial lines provide rigidity to the web, help to absorb impact forces, and transfer vibration down to the centre of the web. Meanwhile the sticky silk (covered in dots of glue) sticks to the prey and tangles it up, keeping it immobilised while the spider responds. 110
Francis Windram @franwin.co.uk · 17/01/20259/ Further out from there is the capture area. This consists of fairly strong radial lines emanating from the hub, and a spiral of sticky silk that creates the mesh of the web. 110
Francis Windram @franwin.co.uk · 17/01/20258/ Out from the hub is the free zone. This silk-free area allows a spider to transition between the rear and front sides of the web, vital for quickly responding to prey strikes on either side of the web. 110
Francis Windram @franwin.co.uk · 17/01/20256/ At the centre of the orb web is the hub. This is often more messy than the rest of the web, and is constructed of non-sticky silk. Its purpose is to provide a nice place for the orb-weaver to sit when it is not actively doing something on the web, and is also the harmonic centre of the web. 110
Francis Windram @franwin.co.uk · 17/01/20254/ So to start off, all spiders produce silk, but only some of them weave webs. The most well-known web weavers are orb weaving spiders (usually but not always of the araneidae family). Spiders use different types of silk for different purposes, from egg sacs to draglines. 110
Francis Windram @franwin.co.uk · 17/01/20253/ That project on the effect of web orientation on web traits led to my entire Master's and PhD being focused on spider web traits! (pic immediately post-submission) 110
Francis Windram @franwin.co.uk · 17/01/20252/ I got into spiders thanks to a field course during my undergraduate at Malham Tarn. Specifically we were late to pick projects and so got stuck with something involving a lot of plant ID, or a weird spider web imaging project. 110