Publications by Michael
Europe COVID-19 death map
COVID-19 deaths in Europe # Europe COVID-19 deaths animated map # http://r.iresmi.net/ # data European Centre for Disease Prevention and Control # packages ---------------------------------------------------------------- library(tidyverse) library(httr) library(fs) library(sf) library(readxl) library(janitor) library(glue) library(tmap) library(...
421 sym R (8141 sym/1 pcs) 2 img
Polygons to hexagons
Hexagon tessellation using the great geogrid package. The départements are the second level of administrative government in France. They neither have the same area nor the same population and this heterogeneity provides a few challenges for a fair and accurate map representation (see the post on smoothing). However if we are just interested in ...
1399 sym R (6940 sym/1 pcs) 6 img
Generalized Monty Hall problem
A simulation of the Monty Hall problem outcomes for n doors (k opened) à la Tidyverse… library(tidyverse) # sample vectors whether they have one or more elements resample <- function(x, ...) x[sample.int(length(x), ...)] monty <- function(doors = 3, monty_opens_doors = 1, n = 10000, seed = 0) { set.seed(seed) tibble(car = sample(doors, n, ...
494 sym R (1267 sym/1 pcs)
Using the geofacet package to spatially arrange plots
The {geofacet} package allows to « arrange a sequence of plots of data for different geographical entities into a grid that strives to preserve some of the original geographical orientation of the entities ». Like the previous post, it’s interesting if you view each entity as a unit and don’t care for its real size or weight, and don’t ...
1038 sym R (4019 sym/1 pcs) 2 img
Trail running : is it worth starting?
Should I stay or should I go ?the Clash https://www.flickr.com/photos/alexismarod/33815546074/ Trail running can be hard. During one, I was wondering if we can avoid the race completely and predict the race time according to distance, elevation change, sex and performance index (so yes, we have to run sometimes to measure it). We need a dataset ...
2882 sym R (6147 sym/12 pcs) 10 img
Playing with Roman numerals
What is the longest year number (yet) written in Roman numerals ? library(tidyverse) tibble(y = 1:2020) %>% mutate(r = as.roman(y), l = str_length(r)) %>% slice_max(l) # A tibble: 1 x 3 y r l <int> <roman> <int> 1 1888 MDCCCLXXXVIII 13 It is year 1888, with 13 characters… And the largest writable ...
778 sym R (1365 sym/5 pcs) 2 img
Does 100 m equal 1 km ?
Climbing or not climbing ? Photo : Alexis Martín In trail running or orienteering people say that if you have to run 100 m of elevation up and down it would take the same time as running flat for 1000 m. We can find a similar old rule of thumb and more recently, some researchers (Davey, Hayes & Norman, 1994 ; Scarf, 2007) added a little scie...
1831 sym R (473 sym/1 pcs)
Simplifying polygons layers
The current 2021 french administrative limits database (Adminexpress from IGN) is more detailed than the original version (from 50 MB zipped in 2017 to 500 MB zipped now), thanks to a more detailed geometry being currently based on the BDTOPO. However we don’t always need large scale details especially for web applications. The commune layer it...
1970 sym R (3235 sym/3 pcs) 2 img