Publications by Florian Privé
A guide to parallelism in R
In this post, I will talk about parallelism in R. This post will likely be biased towards the solutions I use. For example, I never use mcapply nor clusterApply. I prefer to always use foreach. In this post, we will focus on how to parallelize R code on your computer. I will use mainly silly examples, just to show one point at a time. Basics of ...
5375 sym R (6648 sym/16 pcs)
Scraping some French medical school rankings
In this post, I will analyze the results of the “épreuves classantes nationales (ECN)”, which is a competitive examination at the end of the 6th year of medical school in France. First ones get to choose first where they want to continue their medical training. A very clean dataset The data is in a PDF there. I’m not an expert in scraping...
1853 sym R (5614 sym/6 pcs) 4 img
Grenoble RUG: first working session
In this post, I will talk about the organisation of our R User Group (RUG) in Grenoble and our first working session. Organisation Each month, we have a working session of 2 hours. The first hour is dedicated to a presentation/tutorial (you can see the full list online). The second hour is dedicated to meeting people, talking to them and asking ...
2116 sym 6 img
Grenoble RUG: 2nd working session, ggplot2
The slides are available there. For example, you’ll learn Related To leave a comment for the author, please follow the link and comment on their blog: blog. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want...
448 sym 4 img
Shiny App for making Pixel Art Models
Last weekend, I discovered the pixel art. The goal is to reproduce a pixelated drawing. Anyone can do this without any drawing skills because you just have to reproduce the pixels one by one (on a squared paper). Kids and big kids can quickly become addicted to this. Example For this pixelated ironman, you need only 3 colors (black, yellow and ...
1643 sym R (96 sym/1 pcs) 6 img
Teaching an advanced R course
In this post, I come back to my first experience teaching an advanced R course over the past month. Content This course was programmed for 10 sessions (3 hours each) and I initially wanted to talk about the following subjects: R programming and good practices (2 sessions) Data analysis with the tidyverse (3 sessions) R code performance (2 sessi...
4185 sym 2 img
Performance: when algorithmics meets mathematics
In this post, I talk about performance through an efficient algorithm I developed for finding closest points on a map. This algorithm uses both concepts from mathematics and algorithmics. Problem to solve This problem comes from a recent question on StackOverflow. I have two matrices, one is 200K rows long, the other is 20K. For each row (which...
3412 sym R (4827 sym/6 pcs) 2 img
Why loops are slow in R
In this post, I talk about loops in R, why they can be slow and when it is okay to use them. Don’t grow objects Let us generate a matrix of uniform values (max changing for every column). gen_grow <- function(n = 1e3, max = 1:500) { mat <- NULL for (m in max) { mat <- cbind(mat, runif(n, max = m)) } mat } set.seed(1) system.time(m...
3972 sym R (3092 sym/4 pcs) 6 img
One year as a subscriber to Stack Overflow
In this post, I follow up on a previous post describing how last year in July, I spent one month mostly procrastinating on Stack Overflow (SO). We’re already in July so it’s time to get back to one year of activity on Stack Overflow. Am I still as much active as before? What is my strategy for answering questions on SO? My activity on Stack ...
3219 sym R (1101 sym/3 pcs) 2 img
Why I rarely use apply
In this short post, I talk about why I’m moving away from using function apply. With matrices It’s okay to use apply with a dense matrix, although you can often use an equivalent that is faster. N <- M <- 8000 X <- matrix(rnorm(N * M), N) system.time(res1 <- apply(X, 2, mean)) ## user system elapsed ## 0.73 0.05 0.78 system.t...
1888 sym R (2304 sym/6 pcs) 2 img